Conditions

Form conditions are rules Sage checks before it displays the page, tab, question, or option. If the condition isn't met, the element doesn't show

You can use conditions, for example, to make a page or a question conditional upon the answer given to a previous question.

For example, for the question "Do you have any dependants?" you can create a page that lets users enter further details if they select "Yes". Those answering "No" won't see the page.

The condition field is available as an advanced option for:

  • Pages: display the page or tab only if the condition is met

  • Questions: display the question only if the condition is met

  • Options: display the option only if the condition is me

  • Buttons: display the button only if the condition is me

  • Data links: only write the value to the linked object if the condition is met

The examples that follow detail common ways to use conditions for your pages, questions, and data links.

For information about the operators and functions supported for formulas, see Supported operators and functions.

Conditions: examples

Page conditions

You can use page conditions to check the answer to a question on a previous page. Then decide whether or not to show the conditional page. For example, if the Employee Information page asks "Do you have any dependants?", you can display the Dependent Information question page only if the answer is "yes".

Tip Conditional pages don't have to follow the page that has the question that the condition relies on. Any subsequent page can be conditional on the answer to a question on any earlier page.

The question on which the condition depends is as follows:

Screenshot: conditional question

The details of the "Do you have any dependants?" question are:

  • A radio type question

  • Question name: "HaveDep"

  • Options: "Yes" and "No"

We want to make the Dependent Information page or tab conditional on the answer to the question. On the Dependent Information page, the Show Page Conditions field sets to: HaveDep="Yes".

Screenshot: show page conditions formula

This condition sets the page to display only for users who selected "Yes" to the HaveDep question. Those who selected "No" won't see the Dependent Information page and will skip to the next page in the form.

Note The last page of a form can't have a page condition. Don't add conditions to a page with mandatory questions.

See the HCM onboarding form worked example topic Create a new form page and questions for another example.

Question conditions

You can use question conditions to make a question dependent on the answer given to a previous question. For example, if you've previously asked the user's marital status, you can display a question requesting spouse details.

Conditional questions are on a later page in the form than the question that the condition checks. (Form pages don't refresh automatically. If you add a conditional question to the same page as the question that the condition is looking for, it won't display. This is until you refresh the page or go back to it.)

You can build conditions that rely on the answers to more than one question.

In this example, the conditional question is "What is your maiden name?". This question only shows based on the answers to two earlier questions:

  • "What is your gender?" (EmpGender) = Female

  • "What is your marital status?" (EmpMaritalStatus) = Married

The "What is your maiden name?" question has the following condition:

EmpGender="Female" && EmpMaritalStatus="Married"

Screenshot: question condition

Where && is an operator that means AND: both conditions must be true to meet the condition. In this example, the "What is your maiden name?" question only shows if both conditions are true.

See Supported operators and functions for more information about how to create complex conditions.

Data link conditions

You can use data link conditions to write data back to your form's linked objects only if the condition is met. For example, you can set a condition on a data link rule that will check the value of a question field. So the rule only triggers if the value a user enters for that question meets the condition.

NOT (ISBLANK) condition for empty fields

Without conditions, data link rules will create blank records for fields that users leave blank. It's good practice to add conditions for non-mandatory fields that have an associated data link rule. this ensures the rule doesn't create empty records.

In this example, the form has a text entry field for Passport Number (PassportNo). This field is associated with a data link rule that writes the passport number back to a field in the Passports object. It's related to the Team Member record. The condition NOT (ISBLANK(PassportNo)) ensures that, if the user leaves the passport number field blank, the condition isn't met. The data link rule won't trigger.

Screenshot: data link condition, annotated showing the NOT ISBLANK condition