For a form field - Require a field based on another field


Badge +9

If I have 2 fields: Product and Sourcing

If the Product is "Dairy" I want to make "Sourcing" a required field ?  If this is possible can you provide a link on how to accomplish this...


3 replies

Userlevel 4
Badge +12

Hi David,

yes you can do this. In forms designer, select your sourcing field and hit Add Rule in the ribbon.

Change the rule from Formatting to Validation and open the formula designer.

Afterwards create the following rule:

and(contains(Product, "Dairy"), isNullOrEmpty({Self}))

204049_pastedImage_1.png

Last thing is to create a Message, that will be shown if the validation is false.

The formula will check if Product contains Dairy AND sourcing is empty. In that case the form will show the message:

204056_pastedImage_5.png

Hope this helps.

Best regards

Enrico   

Badge +11

Hi David,

you can achieve this by adding a validation rule to your "Sourcing" field like following:

204053_pastedImage_1.png

This rule says that your "Sourcing" field is invalid if it is empty and your "Product" field equals "Dairy". I used a choice field for product here but should work the same way for most other field types. You can use the formula builder to create the formula and use references to fields and runtime functions very easily.

Best Regards

Philipp

Badge

Excellent write up! 

Reply