Task attributes
A task is always created from a case. Task attributes allow you to store values from the related case on the task itself. This is useful if you want to use a dataset of tasks (for example, to display a list of open tasks) and you want to include one or more attribute values from the case associated with each task.
For example, if you are building a multi-tenant application, you may record an Organization ID on each Customer, Quote, and Order case. You may also want to include the relevant Organization ID on tasks related to those cases so that you can see which organization each task relates to.
You could achieve this by adding an inline template column to the dataset that retrieves the Organization ID value from the related case for each task. However, this can lead to performance issues when retrieving values from multiple different casetypes. To avoid this, you can create a task attribute and include that in the dataset instead.
To create a task attribute, navigate to Platform > Task attributes. Task attributes are added to all tasks.
To populate a task attribute you can either:
- Add a mapping to the
On startstage of the activity that creates the task. This option is useful if you want to populate the task attribute from different sources depending on the activity and/or casetype. - Make the task attribute a cached computed attribute, based on a platform attribute. This option is useful if you are using a platform attribute (such as an
Organization ID) across multiple casetypes and it applies to the majority of your tasks.
Each time a task is created, the task attribute value is populated with the value of the platform attribute on the related case. The value is recalculated when the task is modified (for example, when it is submitted). You can also use Developer Tools to recalculate task attribute values manually.
When you configure a cached computed task attribute, the value is calculated for every task in your application. To optimize performance, we recommend using this option only if the attribute value will be populated for the majority of your tasks. If the platform attribute is itself computed, keep the inline template simple to avoid further performance issues.