Use display conditions to show/hide items or sections
Before you start
|
Why would I use wish to show/hide item sections? Common uses include
|
Overview |
Step 1. Identify all the internal ids and unique names
- Internal ids and/or unique names will be required in the conditional statement. It will help if these are written down for reference as they need to be replicated exactly and are case sensitive.
- Many conditions rely on knowing the internal id for list entries. To make this easier they are shown in the list entries list.
- Unique names are also important in creating conditions. Creating meaningful ones will be helpful for future amendments or for reading the conditions that you are about to set up. They usually appear in the Advanced tab of an item but may be elsewhere in some cases.
Step 2. Open the setup for the part that is to be hidden/shown
- This will be either:
- An item type (evaluated on the device)
- A section in a template (evaluated on the device)
- A template action (evaluated on the server)
- All of these are available through Setup/Maintenance->Maintain Templates->[your template name]
- The conditions are entered on the tab called 'Display Conditions (advanced)' or just 'Conditions (advanced)'. There are usually 2 conditions that can be attached to an item which enables both a true and a false condition to be set up.
- NB If a multiple-choice item type is referred to, it may need a scoring
Step 3. Type in the condition.
conditionType |
Only evaluated on the server ie after the form has been sent back to the office
|
uniqueName(or attribute or id) |
This refers to the thing that is to be evaluated, whether in the template or in the job definition. It might be the unique name, an internal id or an attribute (see Concepts - Attributes for more details). Be aware of the following:
|
testType |
This is the type of test you’re doing. You can use:
|
valueToTest |
This is the answer to test against.
|
Samples 1. Evaluated on the device
With reference to the list above, the item to which the condition is attached will only display if ...
With reference to the list above, the item to which the condition is attached will only display if ...
- resultValue;visitStatus;equals;5993
looks for the “visitStatus” item on the form having an answer of “Await parts” - resultValue;visitStatus;isoneof;5993,5992
looks for the “visitStatus” item on the form having an answer of “Await parts” or “Re-visit” - resultValue;visitStatus;notequals;5991
looks for the “visitStatus” item on the form not having an answer of “Complete” - resultValue;revisitRequired;equals;Yes
looks for the “revisitRequired” tick/checkbox being ticked/checked - resultValue;lastVisit;morethanxdaysagoorempty;100
looks whether the “lastVisit” date item is more than 100 days ago - customerAttribute;haveBankDetails;equals;No
looks for the “haveBankDetails” attribute of the current customer being “No” - locationAttribute;isSpecialContract;equals;Yes
looks for whether the “isSpecialContract” attribute of the current location is “Yes” - listItemAttribute;fittingType:isSpecial;equals;Yes
looks for whether the “fittingType” list item selected has its “isSpecial” attribute set to “Yes” - workOrderValue;warrantyType;equals;1234
looks for whether the “warrantyType” specified in the job is a list entry with id 1234 - locationAttribute;isSpecialContract;equals;Yes
looks for whether the “isSpecialContract” attribute of the current location is “Yes” - listItemAttribute;fittingType:isSpecial;equals;Yes
looks for whether the “fittingType” list item selected has its “isSpecial” attribute set to “Yes”
Samples 2. Evaluated on the server- The item to which the condition is attached will only display if ...
- resultValue;visitStatus;equals;Await
parts looks for the “visitStatus” item on the form having an answer of “Await parts” - resultValue;visitStatus;isoneof; Await parts, Re-visit
looks for the “visitStatus” item on the form having an answer of “Await parts” or “Re-visit” - resultValue;visitStatus;notequals; Complete
looks for the “visitStatus” item on the form not having an answer of “Complete” - resultValue;revisitRequired;equals;Yes
looks for the “revisitRequired” tick/checkbox being ticked/checked - resultValue;lastVisit;morethanxdaysagoorempty;100
looks whether the “lastVisit” date item is more than 100 days ago - customerAttribute;haveBankDetails;equals;No
looks for the “haveBankDetails” attribute of the current customer being “No” - locationAttribute;isSpecialContract;equals;Yes
looks for whether the “isSpecialContract” attribute of the current location is “Yes” - hasFollowUp;;equals;True
looks for whether the current form has follow-up actions
Troubleshooting
- When dealing with multiple-choice items it may be necessary to assign a score to 1 or more of the list entries in order to make the condition work.
See Also