Variables

The screenshot above shows a task template for an automated email that gets sent to a new hire’s manager before their first day. You’ll notice that there are quite a few highlighted values surrounded by double curly brackets scattered throughout the template. These are referred to as variables, and they are what allow you to personalize the content of tasks and dashboard cards by populating values from the underlying data layer that is stored within Sora.

Types of variables

There are three different types of variables:

  • Employee data: used to populate a value from a specific field on the profile of the employee going through the workflow.
  • Relationship fields: used to populate a value from a specific field on the profile that is set as a particular Relationship field to the employee going through the workflow (e.g. Manager).
  • Survey responses: used to pull the response given to a particular survey question for the employee going through the workflow.

The screenshot below shows the same task template as before with added annotations identifying the different variable types:

Adding variables

Variables can be used in the following areas:

  • subject line of automated emails
  • body of automated emails
  • task instructions for assignment and survey tasks
  • title of dashboard card
  • body of dashboard card
  • parameters for certain integration tasks

To add a variable in one of these areas, simply type two left curly brackets and then select the appropriate field from the dropdown that automatically appears. You can also specify a fallback value to be used in cases where the referenced field is empty.

Assigning values to variables

When a task gets triggered, Sora will automatically replace each variable with its corresponding value for the specific employee going through the workflow. This value will always reflect the current state for that particular field within Sora’s data layer at the moment the task gets triggered.

Missing variables

When defining a task template, Sora gives you the option to require all variables to have values for sending the task.

If this option is checked and any variable is missing a value when a task gets triggered, Sora will prevent the task from sending. Instead, Sora will display a flag next to the task within the admin view of the workflow which identifies the missing variables. From here, you can easily assign the missing values to allow the task to be sent.

If a variable is missing a value but has a fallback value then Sora will use the fallback value without flagging an issue.