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 by populating values from the underlying data layer that is stored within Sora.
Types of variables
There are three different types of variables that can be used within task templates:
- 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.
- 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:
Variables can be incorporated into task templates in the following areas:
- subject line of automated emails
- body of automated emails
- task instructions for assignment and survey tasks
- 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.
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.
This is particularly important to keep in mind when dealing with fields that are originally set via an integration with another tool. For example, let’s say that we are using an integration to automatically add employees into Sora whenever they get marked as hired within our ATS, and as a part of this process the “Start date” field on the employee’s Sora profile gets set with the value that is stored within the ATS. Now let’s imagine that the new hire’s start date gets pushed back and our recruiter updates this information in the ATS accordingly, but no changes are made to the new hire’s profile within Sora. Because our integration was only configured to run when a candidate is first marked as hired, the “Start date” field within Sora will store the original start date and any variable that references this field will populate this incorrect value. Another way to think about this is that variables are agnostic to how or when a field gets set within Sora – all that matters is the current data within Sora at the time a task gets triggered.
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.