Form Rules Framework

March 16, 2014 , by

Pistachio ships with a rules framework that runs on every Application's Add, Edit, and View pages. This framework allows you to setup rules that can evaluate multiple conditions and then apply results to the displayed page. Multiple rules can be configured per Data Model, with the Execute Order field used to specify the order in which the rules are run. A rule with a later Execute Order can update or undo actions taken by a prior rule.

Creating a rule

Creating a rule allows you to perform conditional configuration on the fields. Click Add New under Rules, five it a name, description and click Save. Lets say our Data Model has two fields:

  • DepartmentId
  • DepartmentOther

We would like to show the DepartmentOther field, only if the user selects a department called 'Other'. Lets say the 'Other' department has a database value of DepartmentId 6.

Next, we will create the condition for our rule. Then we will create results for the rule. Clcik on the [Add New] under conditions to add a condition.

Creating a condition

Creating a result

Our final rule configuration will look like:

Similarly, you would want to add another rule to hide if the Department selected does not have a value of DepartmentId 6.

Please see Rules Configuration