Skip to main content

Hey, I want to create an Action in which at least 1 out of 2 (either one or both) fields should be required. How do I set it up? I have searched the forum but am not finding any way to achieve this combination.

 

Truth table:

 

Field 1 Field 2 Validation
Empty Empty Failed
Filled Empty Passed
Empty Filed Passed
Filled Filled Passed

 

Hey @masterAkayMOE! Are you looking to do this with an app you’re adding to the developer platform or within a Zap you’re building? If the ladder, generally, the best way to implement conditions like these would be to use a Filter step or a Path:

Let us know!


Hey! Thank you for the swift response. I'm looking to do this with an app that I'm developing on the Zapier Platform.


Hi @masterAkayMOE 

You can mark fields required https://platform.zapier.com/docs/input-designer#required 

However, if you only want some logic and both fields aren’t necessarily required, i often see people put helpText to communicate to the end user that one of the fields must be filled out. Then in your code, validate that rule.. if neither field was filled out you can throw an error alerting the zapier user. 
https://platform.zapier.com/cli_docs/docs#zerrors 


Hi @masterAkayMOE,

@GetUWired is correct here. There’s nothing in the platform build for exactly this situation. Most people address it with clear help text. If the user leaves them both blank, your API should, of course, return an error and that will be passed on to the user. We have more documentation on error handling here.

Let us know if you have any more questions!