Rules 

Applying rules and conditions to your form allows it to become interactive, as it can ‘show’ or ‘hide’ form items based on certain conditions or responses given by the participant. 

How to configure Rules

Create your form including all content (form items), formats and layout. 

1. Select the form item that should be used as the condition for your rule and select Rules, then select Add a New Rule, as seen below circled in green. 

Rules

2. Now you must configure your condition(s) and select your action(s).

  • Condition(s) details:
    • The ‘IF’ section is where you identify the condition(s).
      Item - This will default to the form item that you selected, and it will control the condition. You can change the form item by selecting from the drop-down list. 
      Treat Value As - This lets you decide how you want to treat the value of the form item. Select Text, Number or Date/Time.
      Comparison - This allows you to configure how you want to set the condition, depending on how you treat the value there are different options available. 
      Value - This allows you to configure the value that defines the condition, which is based on the applicant’s response to this form item.
  • Action(s) details: 
    • The ‘THEN’ section is where you select the action(s).
      Show or Hide - Identify if you want to Show or Hide a form item based on if the condition(s) is/are met.
      Form Item - Identify the form item that you want to Show or Hide from the drop down menu.
      Show/Hide on PDF? - Checking this box determine if the same action should be Shown or Hidden on the PDF version. Checking this box means that the PDF will display what the applicant sees in the browser view.

3. You can add additional conditions or actions to your rule by clicking on the Add Condition or Add Action buttons. 

  • For additional conditions, you must select the operand of AND or OR.
  • If additional actions are added, all additional actions will be applied based on if the condition(s) are met. 

Rule Restrictions:

  1. Dynamic Forms does not support the use of both AND and OR operators within the same rule. 
  2. A specific Action can only be refenced by a single Rule, so each rule must reference a different Action.  An error will be displayed if you attempt to create 2 or more Rules that reference the same Action.
    Note: See Work-Around 1 below under Tricks using Rules to learn more about a way to reference a single Action in different Rules.

4. Click the Save icon at the top right of your rule to save your configured Rule(s).

Tricks using Rules

You can apply rules to form items to hide them only when certain conditions are met. 

EXAMPLE 1 - Hide an Adviser’s section of the form from a Student. 

Let’s say you created a multi-participant form where a Student initiates the form and then an Adviser gives there approval. Form items for both the Student and Adviser are on a single page but you don’t want the Student to be able to see the Adviser’s section. 

When an Adviser CASes into the form, we can have a Short Answer prefill with that Adviser’s NetID. Since the NetID will only be populated after an Adviser has entered the form, we can configure a Rule that states:

  • IF Adviser_NetID (Treat Value As: Text) Is Answered;
    THEN SHOW Adviser_Section_Table - Show on PDF. 
    (THEN SHOW - List all Form Items that should only be displayed when NetID is populated/specific Participant has accessed the form)

This means the Student won’t be able to see the Adviser’s section, since the Adviser’s NetID won’t be prefilled yet. Once the Adviser accesses the form, their NetID will be prefilled and based on the Rule configured, the Adviser’s section will be displayed. Therefore, only the Adviser will see the Adviser section. 

If you don’t want the Adviser’s NetID displayed on the form, you can configure another Rule that states:

  • IF Adviser_NetID (Treat Value As: Text) Is Answered, 
    OR IF Adviser_NetID (Treat Value As: Text) Is Not Answered;
    THEN HIDE Adviser_NetID - Hide on PDF.

Therefore, the Adviser’s NetID will always be hidden and never displayed on the form or PDF. 

FORM EXAMPLE that uses these Rules can be found in:

  • Organization: eForm Designer Sandbox 
    Form Name: 0 - (Example Form) Yale College - Sophomore-Year College Advising Form
    Form Item: AdviserNetID
    Rules: See Rule 1 where it’s configured to always hide the AdviserNetID and Rule 2 which shows a set of questions only when AdviserNetID is Answered. 

EXAMPLE 2 - Display a dynamic number of form items based on input 

Let’s say you’re asking a Student to identify the number of children under their Yale Health Plan to determine the amount of financial aid they qualify for and need to collect their children’s details. You can ask the Participant/Student to enter their number of children and based on that response display an equal number of set questions. Creating rules that state if number of children = 1, then display Table 1 which includes 1 set of questions, if children = 2, then display Table 2 which includes 2 sets of questions and so on. But that would be inefficient and create a lot of unnecessary empty columns on the back end in the work queue. 

Instead, create rules where the Condition uses the Comparison of Greater Than and the Value that references the number of children, in increments of 1, with the Action that shows 1 additional Table or set of questions for each child based on the Student’s input. 

So you would configure rules that state:

  • IF No_of_Children (Treat Value As: Number) is Greater Than 0;
    THEN SHOW Child1_Table - Show on PDF.
  • IF No_of_Children (Treat Value As: Number) is Greater Than 1;
    THEN SHOW Child2_Table - Show on PDF.
  • IF No_of_Children (Treat Value As: Number) is Greater Than 2;
    THEN SHOW Child3_Table - Show on PDF.
  • IF No_of_Children (Treat Value As: Number) is Greater Than3;
    THEN SHOW Child4_Table - Show on PDF.
  • IF No_of_Children (Treat Value As: Number) is Greater Than 4;
    THEN SHOW Child5_Table - Show on PDF.

This would then reference a single set of Tables, 1 for each additional child. Meaning whether the Student has 1 child, 3 children or 5 children, it will always show at least Table 1. Opposed to creating 5 different sets of Tables and showing a different set of Tables depending on the number of children identified, which would cause numerous empty columns to be created within the Work Queues on the back end. 

FORM EXAMPLE that uses these Rules can be found in:

  • Organization: eForm Designer Sandbox
    Form Name: 0 - (Example Forms) Ph.D. Family Support Enrollment Form - Phase II 
    Form Items: Children_Number; Children_Table
    Rules: Rules 7 - 16 where it’s configured to show an additional table as the Children_Number increases.

WORK-AROUND 1 - Reference the same Action in different Rules

Each rule must reference a different Action. Therefore, you cannot have more than one rule that references the same Action. 

Problem:

Lets say you want to SHOW FormItem1 when conditions ‘A and B’ are met AND when conditions ‘C or D’ are met. The Rules would look like: 

  • IF A AND B are met; 
    IF C OR D are met; 
    THEN SHOW FormItem1.
  • But you cannot include both an AND operand with an OR operand within the same Rule condition. 

If you wanted to split it into 2 separate rules, it would look like this: 

  • IF A AND B are met; 
    THEN SHOW FormItem1.
  • IF C OR D are met; 
    THEN SHOW FormItem1.
  • But you also can’t create 2 Rules that reference the same Action. 

So what do you do if you can’t find a legit way to configure the rules knowing you must reference the same Action = Show FormItem1?

Work-Around:

To get around this, you can embed the Form Item within a Table and continue embedding within another Table for as many times as you need to reference that Action. Therefore, one Rule can reference the Form Item itself, another Rule can reference the first Table, another rule can reference the second Table and so on. 

Embedding a FormItem1 within a Table (Table1), embedded within another Table (Table2) would look like this:  

Embedded Tables_Rules

The Rules would be separate, referencing different Actions, but showing the same Form Item in all 3 Rules: 

  • IF A AND B are met; 
    THEN SHOW FormItem1.
  • IF C OR D are met; 
    THEN SHOW Table1.
  • IF E is met; 
    THEN SHOW Table2.

FORM EXAMPLE that uses these Rules can be found in:

  • Organization: eForm Designer Sandbox
    Form Name: 0 - (Example Form) 2019 - 2020 YSM Financial Aid Application for Incoming Students
    Form Item: PA_Semester_Enrolled_Table and the form items found within the Table found on Page 2 - General Information
    Rules: Rule 14 references the PA_Semester_Enrolled_Table; Rule 69 reference all the form items found within the PA_Semester_Enrolled_Table, therefore both Rules show the same Action of displaying the same Form Items by referencing the Table for Rule 14 and referencing each Form Item within the Table for Rule 69.

Questions? Contact Dynamic Forms ITS Team by emailing DynamicForms.ITS@yale.edu