Skip to main content
Best answer

At least one field required


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

 

Best answer by GetUWiredBest answer by GetUWired

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 

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

4 replies

jesse
Forum|alt.badge.img+9
  • Architect
  • 1348 replies
  • July 5, 2022

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.


GetUWired
Forum|alt.badge.img+12
  • Zapier Expert
  • 1030 replies
  • Answer
  • July 7, 2022

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 


shalgrim
Forum|alt.badge.img+8
  • Zapier Staff
  • 406 replies
  • August 12, 2022

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!