1

I am making an Action in Zapier for my App.

I have two fields where only one needs to be filled. For eg: The user can either enter the email or phoneNumber but not both.

So I cant use the 'Required' attribute because it will ask user to enter both. I couldnt find a solution in the Zapier Documentation also.

Kindly Help

Thanks

hybrid
  • 1,255
  • 2
  • 17
  • 42

1 Answers1

0

David from the Zapier Platform team here.

The best way to do this is mark neither field as required, but include help text for each field that mentions that either one or the other is needed.

Then, before you make your request, verify that a || b is true. If it's not, throw an error telling the user they have to supply either.

Hope that clears it up!

xavdid
  • 5,092
  • 3
  • 20
  • 32
  • Thanks @xavdid .In my scenario, I guess its better to create two Actions with different 'Required' fields rather than sending an error to user. – hybrid Jul 20 '17 at 08:03
  • Possibly! Validation errors during setup are a great way to notify users that they need to set things up differently. That said, if the actions are pretty distinct, it makes sense to have them be separate actions. ​Let me know if you've got any other questions! – xavdid Jul 20 '17 at 16:10