0 0 0 0

NEX-Forms Documentation

Conditional Logic
What is Conditional Logic?

Conditional Logic is a feature in NEX-Forms that gives you the ability to show, hide and perform specific actions on other fields based on what the user selects or enters. Basically, this changes the form to the user's needs in real-time saving your user time, effort and frustration.

Creating Conditional Rules

In this example we will use a "Contact Form" with a contacting method to hide and show relevant fields based on the user's selection.

NEX-Forms Docs - Figure
  1. Open the Conditional Logic rules manager from the tool panel.
    NEX-Forms Docs - Figure
  2. The Conditional Logic Manager will open on the right hand side of the builder.
    NEX-Forms Docs - Figure
  3. To add a new rule click on Add Rule
    NEX-Forms Docs - Figure

Now we can setup this new rule!

NEX-Forms Docs - Figure

For this rule we want to have the "Contact Method" field to show the "Email" field if the Email option is selected.

The "IF"
  1. Choose the field to trigger the condition. In this case it will be the Contact Method field
    NEX-Forms Docs - Figure
  2. Choose the condition. In this case we need to use Equal To
    NEX-Forms Docs - Figure
  3. Add the value. We know that option 1 has a value called Email. So we will add "Email" into the value field (NOTE: this is case sensitive).
    NEX-Forms Docs - Figure
That concludes the IF part of the rule.

We now have:
IF Contact Method is Equal to the value Email

The "THEN"

Now we can setup what happens if this IF part is true. Remember, in this example we will show the Email field when the Email option is selected from the Contact Method field

  1. Choose the Action. In this case we will select Show
    NEX-Forms Docs - Figure
  2. Choose the field that will be affected (show) by the IF trigger. In this case it will be the "Email" field. Note: the Email field is a text field so it will be found under the text fields section in the dropdown menu.
    NEX-Forms Docs - Figure
That concludes the THEN part of the rule.

We now have:
IF Contact Method is Equal to the value Email THEN Show the text field called Email


NOTE: If the condition is false (value is not Email) then the chosen action will be reversed. In this example we stated that if Contact Method is equal to the value Email then Show the the Email field. So if the Contact Method field is not Email then this will hide the Email field, in other words reverse the action.


Repeat this for the other options in the contact methof so your rules look like the graphic below.
NEX-Forms Docs - Figure
NOTE: Fields that are shown from conditional rules are hidden when the form loads. The fields will only show when the condition(s) are TRUE and will always be hidden otherwise.
NOTE: When adding new fields to your form you will need to hit Refresh Fields in the logic section for the new fields to become available in the selection lists.
NEX-Forms Docs - Figure
Creating Advanced Conditional Rules

In this example we will create an advanced rule to show the Submit button AND a thank you message only when both the Email field AND Query field contains no values.

NEX-Forms Docs - Figure
  1. Open the Conditional Logic rules manager from the tool panel.
    NEX-Forms Docs - Figure
  2. The Conditional Logic Manager will open on the right hand side of the builder.
    NEX-Forms Docs - Figure
  3. Click on "Show Advanced Options" so that its checked(this can be swicted at any time).
    NEX-Forms Docs - Figure
  4. To add a new rule click on Add Rule
    NEX-Forms Docs - Figure

You will now have a new rule with advanced options.

NEX-Forms Docs - Figure

The "IF"
  1. Select whether ANY or ALL of the rule's conditions should be true for the actions to be triggered (executed). In this case we want to show the Submit if both Email AND Query is not empty so we will select ALL
    NEX-Forms Docs - Figure
  2. Choose the first field to trigger the condition. Lets choose Email
    NEX-Forms Docs - Figure
  3. Choose the condition. In this case we need to use Not Equal To
    NEX-Forms Docs - Figure
  4. Add the value. We want the action to trigger if the field is not empty so we will leave this value empty.
    NEX-Forms Docs - Figure
  5. Add Another Condition. We now have our email field setup but we need to do the same for Query. So we click on "Add Condition"
    NEX-Forms Docs - Figure
  6. Choose the second field to trigger the condition. Lets choose Query
    NEX-Forms Docs - Figure
  7. Choose the condition. In this case we need to use "Not Equal To"
    NEX-Forms Docs - Figure
  8. Add the value. We want the action to trigger if the field is not empty so we will leave this value empty.
    NEX-Forms Docs - Figure
That concludes the IF part of the rule.

We now have:
IF Email AND Query is not Equal to Empty

The "THEN"

Now we can setup what happens if this IF statements are true. Remember, in this example we will show the Submit button and the thanks you message only when the Email AND Query fields does not contain a value.

  1. Choose the Action. In this case we will select "Show"
    NEX-Forms Docs - Figure
  2. Choose the field that will be affected (show) by the IF trigger. The first field we will add is the Submit. Note: the Submit field is a button field so it will be found under the buttons section in the dropdown menu.
    NEX-Forms Docs - Figure
  3. Add Another Action. We now have our Submit field setup but we need to do the same for the Thank you message. So we click on "Add Action"
    NEX-Forms Docs - Figure
  4. Choose the Action. In this case we will select "Show"
    NEX-Forms Docs - Figure
  5. Choose the field that will be affected (show) by the IF trigger. The second field we will add is the thank you message. Note: the Thank you message is a heading field so it will be found under the headings section in the dropdown menu.
    NEX-Forms Docs - Figure
That concludes the THEN part of the rule.

We now have:
IF Email AND Query is not Equal to Empty THEN show the Submit button AND the Thank you message

NOTE: If ALL or ANY of the conditions are false then the chosen actions will be reversed. In this example we stated that IF Email AND Query is NOT EQUAL to EMPTY then SHOW the the Submit button and thank you message. So IF the Email AND Query fields are EMPTY then the Submit button and thank you message will remain hidden.
NOTE: You can have unlimited conditions for a rule for the action(s) to be triggerd. You can have unlimited actions to take if a condition or muliple conditions are true.