•••
 
Documentation   /   Building workflows   /   Task variables, answers and aliases
 
 

Task variables, answers and aliases

 

As a task runs, every answer becomes a variable that later items can use.

Where task variables come from

Source Variable name Example
Launch form field or API value The field name {{candidate_name}}
An item's answer The item's ID {{salary}}
An item's answer, by alias The alias (most recent answer wins) {{nda}}
A document created or fetched by an item {ID or alias}:{document variable} {{nda:a_counterparty_name}}
Built-in task values Fixed names {{checklist_key}}, {{checklist_name}}

The answer of an item depends on its action. For a question it's the text of the chosen answer. For a text input it's the text entered. For a date it's the date. For a document action it's the document key. For a Hidden item, it's the ---answer value.

Using an answer later

--#item:
---id:salary
---title:What salary are you offering?
---action:text_input
---input_type:amount
---string_format:currency
---outcome:confirm

--#item:
---depends_on:salary
---id:confirm
---title:Confirm the offer
---description:You're offering {{salary}} to {{candidate_name}}.
---action:done

Variables work in titles, descriptions, options, email fields, ---pass_variables and most other directives. Logic statements work there too, for example [[IF=salary(GREATER_THAN £50000)]]Needs director approval.[[ENDIF]].

Aliases

An alias is a second name for an item. Unlike IDs, aliases can be shared. Use a shared alias when several alternative items produce the same kind of value, such as two document items in different branches. {{alias}} returns the answer of the last item with that alias to be answered.

Data from documents

When an item creates, copies or fetches a document, every variable in that document is available by prefixing it with the item's ID or alias:

{{offer_letter:a_counterparty_name}}
{{offer_letter:salary}}
{{offer_letter:a_date_start}}

Document variables lists the built-in document fields.

Built-in task variables

Variable Value
{{checklist_name}} The task's name
{{checklist_key}} The task's unique key
{{checklist_url}} The full URL of the task
{{document_url_base}} https://{your_account}.plainly.com/a/. Put a document key after it to make a link.
{{is_assigned}} true or false
{{assigned_to_name}}, {{assigned_to_email}}, {{assigned_to_phone}}, {{assigned_to_pic}}, {{assigned_to_id}} The assigned user's details
{{u_name}}, {{u_email}} The user actioning the step. Don't use these in automatic actions, which may run with no user.
{{*now}}, {{*today}} and other constants See Constant variables
Important

Launch form and API variables can't be overwritten by an item ID or alias with the same name. Keep item IDs and aliases different from launch form field names.