Understanding the New Task-to-Resource Relationship
Overview
Task is the parent object of all types of tasks such as Approval, Prompt, User Task, other Custom tasks, etc. All these tasks inherit from Task object.
- User Task: new type of task that users can create a record of from a Task report.
- Prompt Task: type of task that presents the user with a form or a pop-up picker window, to input data for use in the workflow (User Input activity).
- Approval Task: type of task that presents the user with approval or reject buttons for use in the workflow (User Action activity).
- Custom Task: type of task derived from User Task.
With the new Task-to-Resource relationship, you can now list tasks associated with an editable resource in a form using a single relationship. Editable resources are objects that tasks can be linked to - such as the Person object. This unified relationship makes it easier to retrieve and display all tasks (currently Prompt and Approval tasks) related to a specific resource.
The Prompt Task and Approval Task each have separate existing relationships to resource. To ensure backward compatibility, those existing relationships have been retained. However, with the introduction of the new Task-to-Resource relationship, called References record, a single relationship is now sufficient to achieve the same result, simplifying configuration and improving consistency.
Summary of the available Task-to-Resource relationships:
Type | Relationship name (forward) | Relationship name (reverse) |
|
---|---|---|---|
Task | References record | Referenced by tasks | New relationship |
Prompt task | Record | Prompt task | Existing relationship |
Approval task | Record | Task | Existing relationship |
Task-to-Resource relationship (Forward Direction - Many to One)
When writing expressions & reports that return the resource associated to a task, expressions [References record] & [Record] will return the same result. The benefit of using References record is that it can be used without casting a task to specific type and thus expressions and reports are simpler. In the example below, the user Heidi Shaffer has an Approval task and a Prompt task assigned to her.
Task-to-Resource relationship
By using the References record relationship, we can see all the resources associated to tasks without needing to cast the tasks to their specific types, i.e. Approval and Prompt Tasks
Approval & Prompt Tasks to Resource relationship
When showing resources associated to tasks, using the old relationships requires a conversion to the specific type of task before accessing the Record relationship for both Approval and Prompt tasks
Resource-to-Task relationship (Reverse Direction - One to Many)
When writing expressions & reports that return tasks assigned to a resource, there will be differences depending on which relationship is used. When using the new relationship, an extra check on the resource type of the task is required to maintain the same behaviour as using the older relationships.
However, if the type of task is not important, e.g. getting the count of all Tasks, then it is recommended to use the new Referenced by tasks relationship as this will result in simpler expressions. For example, to count Approval Task and Prompt Task:
Old / Existing | New | |
count Approval Task only | count([Task]) | count([Referenced by tasks] where [Resource Type] = 'Approval Task') |
count Prompt Task only | count([Prompt task]) | count([Referenced by tasks] where [Resource Type] = 'Prompt Task') |
count Approval and Prompt Tasks | count([Task]) + count([Prompt task]) | count([Referenced by tasks] |
In the example below, the user Heidi Shaffer has an Approval task and a Prompt task assigned to her.
Report of Tasks assigned to Record - Referenced by tasks
This report follows the new Referenced by tasks relationship and shows that the user has two tasks assigned.
The Count column is a calculated column with the following expression count([Referenced by tasks]).
Report of Tasks assigned to Record - Prompt task and Approval task
This report follows the existing Prompt task and Task relationship and shows that the user has one of each assigned.
The Count column is a calculated column with the following expression count([Prompt task]) + count([Task]).
Form with Tasks assigned to Record - Referenced by tasks
In these examples we can make use of the Referenced by tasks relationship to show all the tasks assigned to a resource.
How to Configure and Use the Task-to-Resource Relationship
configure References record
To see record associated to each task (currently Prompt and Approval tasks) in your Task report, use References record relationship:
- With admin access, go to Task report.
- Click gear icon on the right side then click Modify Report to open Report Builder.
- On the left panel, tick Reference record checkbox.
- You should now see a Reference record column in your report that displays the associated record for each Approval Task and Prompt Task.
- Click Save.
Configure Referenced by tasks
To see tasks (currently Prompt and Approval tasks) associated to a resource, use Referenced by tasks relationship:
- With admin access, go to resource, e.g. Person object
- Click gear icon on the right side then click Modify Form to open Form Builder.
- On the left panel, drag-and-drop Referenced by tasks relationship onto your form.
- You should now see a section for the list of tasks associated to the record.
- Click Save.