AMS templates contain some features that assist in making more complicated forms and process. Visibility rules allow you to control when a field is shown to the user and link conditionals can change the destination of a link command depending on information in the message.
Visibility Rules
A visibility rule works by comparing the value of an existing value in the current message with that defined in the rule. It uses the comparison type, such as 'is' or 'is not', from the rule to determine if the rule should be applied and the field displayed on the screen.
To create a visibility rule for a field change the 'Visibility' option from 'Always Shown' to 'When'. After doing this more options should appear, similar to those in the image below.

The next popup menu is the field or meta data item in the current template you want to use as the source of the value to compare with. The next menu is the type of comparison to make and the final menu or text field is the value to compare against. Only meta data items, string fields, text fields and choice groups can be used as the source of a value from the message. To remove the rule just change the first popup menu from 'When' back to 'Always Shown'.
An example is a Job message. In this scenario a message is sent to a phone that represents a Job. The Job has a meta data item with a label of "STATUS". When the job is sent out the value of "STATUS" is "PENDING". We require that a user "accepts" a job before more information is available. We also want a message to be sent back to the office to show that the user has accepted the job. To do this we set the default value of the "STATUS" meta data key to be "PENDING" we then add visibility rules to fields that are only available once the job has been accepted.
Link Commands
In addition to link commands just taking the user from one card to another, they can also take you to another template or a different card or template based on a condition.
Links To Templates
In addition to Link Commands allowing the user to move from one card to another, they can also move to a separate template. This is different to using a list card with a child template and instead takes you directly to the root card of the linked template.
| Data Format When data from a linked template is exported it will be contained within an XML tag that has the name of the external label of the template that is the destination of the link command. If accessing this data from within a Route Context the name of the external label of the destination template will be the key in the data map and the value will be another Map with the data from the linked template. |
Conditional Links
As well as linking to cards or templates you can also set up multiple destinations that are only triggered if the provided condition is meet. These conditions are simple rules that check for a value in the message and compare that with the one provided. You can have as many conditional rules per link command as you like.

An example is a customer survey message. Depending on who the client is different questions need answering. Instead of requiring a link command to each client's questions and the user having to choose the right one we instead set up a single link command with conditionals for each client. This makes it easier for the user as they select the same command on the phone each time and then fill out the questions that appear. To achieve this we set up a choice group called Client with choices for each possible client. We then create a link command and set the command type as 'Conditional' and the click the 'Add Rule' button. For our new rule we first set the target by selecting the type as 'Card' then the target card from the adjacent menu. To set the condition we choose the source meta data key or field for the value to compare with ('Client'), then set the type of comparison to make ('is') and finally the name of the required client.