You can use variables in your workflow template. Each variable allow you to include a field value from your record in the template. Each variable is replaced with its corresponding field value when the workflow template is evaluated. You can use an expression variable to compute a value in your template. For example, you could compute a "Total" value by multiplying the "Qty" field by the "Price" field.
Variables take three forms:
- Column name variables
- Expression variables
- Built-in variables
Column name variables allow you to include column data values in your workflow. The name you specify must exactly correspond to the column name in your table. Column name variables take the form <<ColumnName>>. For example, if your table column name is "Order Number", the column name variable is <<Order Number>>. The column name variable is replaced by the value of that column.
Expression variables allow you to compute values using AppSheet expressions. The expression variable in the template is replaced by the computed value of the expression. You can use any AppSheet expression in a variable. For example, the expression variable <<[Amt]*[Qty]>> is replaced with the value of the "Amt" column multiplied by the value of the "Qty" column.
You can include data values from records that are referenced by the current record. For example, assume the current record is an Order Detail record containing a "Ref" to its parent "Order" record. Assume the "Ref" field in the "Order Detail" table is called "OrderRef", and the "Order" record contains field "Order Date". The expression variable <<[OrderRef].[Order Date]>> is replaced with the value of the "Order Date" field from the "Order" table.
You can use the value of referenced fields in expressions. For example, you could compute the date seven days after the "Order Date" by using the expression <<[OrderRef].[Order Date]+7>>.
Built-in variables allow you to customize workflow with built-in values supplied by AppSheet. Built-in variable names always begin with a mandatory underscore. AppSheet supports the following built-in variables:
- <<_APPID>>: Application GUID (Globally Unique Identifier) that uniquely identifies your application e.g. “8c26466f-1db0-4032-9c0f-40c2a588cf50”.
- <<_APPNAME>>: The name of your AppSheet application e.g. “Workflow-10301”.
- <<_APPOWNER>>: The Owner ID of your AppSheet application e.g. “10301”.
- <<_ATTACHMENTNAME>>: The name given to the attachment.
- <<_NOW>>: The current date and time e.g. "6/15/2009 1:45:30 PM".
- <<_ROWKEY>>: The key value of the added, deleted, or updated record.
- <<_ROW_WEB_LINK>>: URL that refers to the added or updated record in your AppSheet application. For example, you can include this URL in a workflow email to allow the email recipient to easily open the added or updated record. The record key is displayed as the link name.
- <<_ROW_WEB_URL>>: URL that refers to the added or updated record in your AppSheet application. For example, you can include this URL in a workflow email to allow the email recipient to easily open the added or updated record. The full URL is displayed. We normally recommend using <<_ROW_WEB_LINK>> rather than <<_ROW_WEB_URL>> because the former is more concise.
- <<_RULENAME>>: Name of your workflow rule e.g. “My Update Rule”.
- <<_TABLENAME>>: Name of your table e.g. “Orders”.
- <<_TIMENOW>>: The current time e.g. "1:45:30 PM"
- <<_TODAY>>: The current date e.g. "6/15/2009".
- <<_UPDATEMODE>>: The name of the operation that triggered the workflow rule. Namely, “Add”, “Delete” or “Update”.
- <<_USEREMAIL>>: The current user’s email address e.g. “firstname.lastname@example.org”.
- <<_USERNAME>>: The current user’s name e.g. “Julie Morgan”.