TABLE OF CONTENTS


Rules Editor


Set up a simple rule


Rules is a very powerful tool used to control behaviour within your script based on IF \ ELSE statements


If you click on the rules button in the top menu bar


The rules editor should show


If you click on Add Rule you will see a new rule row is created below


Click on the green Edit Rule Button the right hand side of the row, this will take you to rule editing screen.

On the left hand side you can name your rule, and also make it active \ inactive.


Once you have decided on a rule name , go to the right hand panel and you will see an IF rule row by default


This is where you can add an IF rule and then corresponding ELSE rules if needed.


To create the IF rule click on the green edit button the right hand side.


You should then see the IF rule creation screen


On the left hand side you can name the IF rule


The middle panel is where you specify the fields used as part of the IF rule, so in this example we are going to make a field invisible based on the result of a different field


In the middle panel choose 'select title' which will take you to a preview of your script and all the fields within, in this example i have two fields, a drop down field and an input field


If we choose the drop down field


You will then see that it has populated the 'select a field' section to the field you chose


We now need to choose the parameter of the field the IF rule will activate from


You will see a drop down to choose different parameters for the result called 'select an option'


Next to this you will see the different options from the drop down field that was selected


NOTE - this is an example field, if you use an input field you will need to type the result you want the rule to work from, you will only see a drop down of options if you use a drop down in the IF rule


for this example we have said


If field "select-418" = British Gas


To complete the rule we now need to add behaviour based on the result parameters, in the right hand panel are the options for what can be done, you can choose either field or group.


For this example we will choose field, see further down the article for what a group is and how to create one.


You can then choose the behaviour you want to happen. In this example we are going to choose "set a field value"


The click "select a field" to choose the field you want to set the value for


In the far right box, you can then type what you want the value to be, in this example we will set this as "BritGas"



Click done with group


Back at the editing rule screen choose done with rule


Back at the rule editor screen choose done


Back on the script if i now choose "British Gas " from the drop down field


Current supplier will now populate with "BritGas" when undertaking a live preview.


Other Options

In the rule editor you can add multiple rules for different parts of the page you are on, by clicking add rule at the top


You can clone a rule to save time if you are making rules that are similar by licking the clone button 


You can delete a rule by clicking the delete button the rule row


In the rule editing screen you can add ELSE or ELSE IF to your IF rules


When editing an a condition you can choose a page as well as a field 


When choosing the THEN section of the condition you can select group


A group is a selection of fields, this way you do not need to set a separate IF rule for every field you can do many at once.


Click edit field groups

 

Click new field group


You can now name the group and choose multiple fields that will make up this group


Click done to go back


you can choose the group you just made to the THEN section 


As a group is multiple fields, you can only choose the actions INVISIBLE and VISIBLE