Administrator Guide 2017
Use display conditions to show/hide items or sections
Before you start
  1. Which parts of the template do you wish to conditionally show or hide? Identify the areas that are cluttering up the forms on the device and may be used only on rare occasions.
  2. Is there a simple condition that can be used to decide when it needs to be available to the device user? Write a list of the occasions on which they are required (or not required) and look for common conditions.  Simplify the condition including assessment on whether it should apply to showing or hiding.  Identify whether the condition applies within the template or as an external action - in other words is it better to show/hide part of this template or would it make sense to use a template action to create a summary form or new form.
  3. Do you wish to apply any conditions to the report? Apply similar considerations for occasions when parts of the report will or will not be required.
Why would I use wish to show/hide item sections?
Common uses include
  1. De-clutter device screens for normal situations to improve speed of data collection
  2. Guide device users through which prompts need to be filled in to improve the accuracy of data collection
  3. Provide concise and focussed reports for your customers or for your own records
Overview
  1. Step 1. Identify all the internal ids and unique names.
  2. Step 2. Open the setup for the part that is to be hidden/shown
  3. Step 3. Type in the condition.
  4. Samples 1. Evaluated on the device
  5. Samples 1. Evaluated on the server
Step 1. Identify all the internal ids and unique names
  1. 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.
  2. Many conditions rely on knowing the internal id for list entries. To make this easier they are shown in the list entries list.

  3. 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
  1. This will be either:
    1. An item type (evaluated on the device)
    2. A section in a template (evaluated on the device)
    3. A template action (evaluated on the server)
  2. All of these are available through Setup/Maintenance->Maintain Templates->[your template name]

  3. 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.

  4. NB If a multiple-choice item type is referred to, it may need a scoring
Step 3. Type in the condition.

conditionType

               
  • resultValue – test the result of (ie data entered in) an item on the form.  Refers to Id.  Also rV for short entry areas
  • resultValueX - test the result of (ie data entered in) an item on the form.  Refers to Text. Also rVX for short entry areas
  • workOrderValue – test the value of an item in the associated job sent from the server
  • workOrderRowCount -
  • customerAttribute – test for an attribute of the current customer
  • locationAttribute – test for an attribute of the current location
  • listItemAttribute – test for an attribute of a list-based answer on the form
  • buttonSequences – test for whether a sequence of action buttons on the form have been activated
  • resultValueDayOfWeek -
  • sectionResultValue -
  • hasJob – test for whether the current form is associated with a job
  • showHelp
  • multiResultValue - test for several results at the same time, for example whether the answer 'yes' has been given to any of several questions.  This might appear as multiResultValue;question1,question2,question3;equals;12345 where 12345 is the id for 'yes' in a list.
  • multiResultValueX - test for a particular text appearing in one of several results, for example whether the word 'fail' appears in a Text item, a multiple choide item or a drop-down list.  This might appear as multiResultValueX;question1,question2,question3;contains;fail or it might be multiResultValueX;question1,question2,question3;notcontains;pass

Only evaluated on the server ie after the form has been sent back to the office

  • hasFollowUp – test for whether the current form has associated follow-up actions
  • hasOutstandingFollowUp – test for whether the current form has outstanding follow-up actions
  • substituteValue or sV - used to test for a value which needs to be calculated such as the value of a template item or customer id

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:
  • Device-side tests on list entries use the list entry id, whilst the server-side uses the list entry text.  This has been somewhat superseded by the use of rvX etc.
  • Attributes are either standard or bespoke.
  • Unique names are case sensitive so make sure the capitals are in the right place.
  • Special items:
    • %CUSTOMER_EXTERNALPK% tests agains the Customer externalPK

testType

This is the type of test you’re doing. You can use:
  • equals – test for a specific value
  • lowerequals - removes case sensitivity for matching
  • notequals – test for the value not being the specified one
  • lowernotequals - removes case sensitivity for matching
  • gt - greater than
  • gte - greater than or equals
  • lt - less than
  • lte - less than or equals
  • empty – test for whether no value is present
  • notempty – test for whether any value is present
  • isoneof – test for a number of values (separate each value with a comma)
  • morethanxdaysagoorempty – test whether a date item has a value more than the specified number of days ago (or it’s empty)
  • complete – test whether a sequence of action buttons has been fully completed
  • incomplete – test whether a sequence of action buttons is incomplete
  • contains - test for partial match
  • notcontains - test for partial non-match
  • like - partial match

valueToTest

This is the answer to test against.
  • For a tick/checkbox it needs to be Yes or No
  • For text-based answers it’s just the text
  • For list-based answers on the device, use the internal Id of that list entry
  • For list-based answers on the server, use the text of the list entry
Samples 1. Evaluated on the device

With reference to the list above, the item to which the condition is attached will only display if ...
  1. resultValue;visitStatus;equals;5993
    looks for the “visitStatus” item on the form having an answer of “Await parts”
  2. resultValue;visitStatus;isoneof;5993,5992
    looks for the “visitStatus” item on the form having an answer of “Await parts” or “Re-visit”
  3. resultValue;visitStatus;notequals;5991
    looks for the “visitStatus” item on the form not having an answer of “Complete”
  4. resultValue;revisitRequired;equals;Yes
    looks for the “revisitRequired” tick/checkbox being ticked/checked
  5. resultValue;lastVisit;morethanxdaysagoorempty;100
    looks whether the “lastVisit” date item is more than 100 days ago
  6. customerAttribute;haveBankDetails;equals;No
    looks for the “haveBankDetails” attribute of the current customer being “No”
  7. locationAttribute;isSpecialContract;equals;Yes
    looks for whether the “isSpecialContract” attribute of the current location is “Yes”
  8. listItemAttribute;fittingType:isSpecial;equals;Yes
    looks for whether the “fittingType” list item selected has its “isSpecial” attribute set to “Yes”
  9. workOrderValue;warrantyType;equals;1234
    looks for whether the “warrantyType” specified in the job is a list entry with id 1234
  10. locationAttribute;isSpecialContract;equals;Yes
    looks for whether the “isSpecialContract” attribute of the current location is “Yes”
  11. 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 ...
  1. resultValue;visitStatus;equals;Await
    parts looks for the “visitStatus” item on the form having an answer of “Await parts”
  2. resultValue;visitStatus;isoneof; Await parts, Re-visit
    looks for the “visitStatus” item on the form having an answer of “Await parts” or “Re-visit”
  3. resultValue;visitStatus;notequals; Complete
    looks for the “visitStatus” item on the form not having an answer of “Complete”
  4. resultValue;revisitRequired;equals;Yes
    looks for the “revisitRequired” tick/checkbox being ticked/checked
  5. resultValue;lastVisit;morethanxdaysagoorempty;100
    looks whether the “lastVisit” date item is more than 100 days ago
  6. customerAttribute;haveBankDetails;equals;No
    looks for the “haveBankDetails” attribute of the current customer being “No”
  7. locationAttribute;isSpecialContract;equals;Yes
    looks for whether the “isSpecialContract” attribute of the current location is “Yes”
  8. hasFollowUp;;equals;True
    looks for whether the current form has follow-up actions
Troubleshooting
  1. 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