Custom task weighting gives you ultimate flexibility in setting your tasks' weights, so that you are in control of how much they contribute to project (and task group, if applicable) progress.
While the ways to configure and automate custom task weighting are endless, one common use case is to use the number of checklist items to represent the related task's weight. In this article, we will walk through a sample configuration to automatically set the task's weight based on how many checklist items are added to the task.
Here is a summary of what will be covered in this article:
Automatically update the Custom Task Weight field on the task according to how many checklist items are added to the task.
- Tasks can be configured to have checklists added to them.
- With the Custom Task Weighting functionality, it is possible to set different weights on tasks using various criteria.
- In this article, we will be setting the task weights based on how many checklist items are added to them.
For the purpose of this automation, it is necessary that your org is set up to have Custom Task Weighting Mode enabled. Follow the steps in this article and set your org's task weighting mode to custom.
We will also be setting up a custom field on the TaskRay Task object. This will be a rollup summary field that counts the total number of checklist items related to a task. This field will be used as a reference to set the custom weight on a task.
The objects involved in this configuration (TaskRay Task, TaskRay Checklist Item) are in a master-detail relationship. This allows setting up a rollup summary field on the TaskRay Task object that summarizes checklist information.
- The automation is set up using Flow. The Flow is triggered whenever the custom Total Checklist Items rollup field is updated.
- Using the value set in the Total Checklist Items field on the task, the Custom Task Weight field will be updated accordingly.
For the first portion of configuring this automation, it is necessary to create a new field on the TaskRay Task object. The field will be used to count the total number of checklist items related to a task.
- From Setup, navigate to Objects and Fields | Object Manager.
- Click on the TaskRay Task object.
- Under Fields and Relationships, click on New.
- Select Roll-Up Summary and click Next.
- Enter Field Label (e.g. "Total Checklist Items"). The Field Name should automatically populate. Optionally, enter Description and Help Text.
- Click Next.
- For Summarized Object, select TaskRay Checklist Items.
- Under Select Roll-Up Type, select Count.
- Under Filter Criteria, select All records should be included in the calculation.
- Click Next.
- Using the checkboxes, edit field-level security, if necessary. Click Next.
- Select if you want to add the field to the Project Task Layout and click Save.
Below is a sample configuration of the Flow:
- From Setup, navigate to Process Automation | Flows.
- Click on the New Flow button.
- In the New Flow modal, select the Record-Triggered Flow option.
- Click on Create.
When setting up a new record-triggered flow, it is necessary to specify the object and criteria that will trigger the automated process. In this case, we will select the TaskRay Task object because our automation should be triggered when the Total Checklist Items field is updated to reflect the number of checklist items added to the task.
- In the Configure Start modal, click into the Object field and search for TaskRay Task.
- For Trigger the Flow When select A record is updated.
- In the Set Entry Conditions section, for Condition Requirements select All Conditions Are Met (AND).
- For the condition, set the following:
- Field = Total_Checklist_Items__c (Total Checklist Items)
- Operator = Is Changed
- Value = True
- For Optimize the Flow for, select Fast Field Updates.
- Leave the remaining options as-is and click Done.
Next, you will need to add an element to update the task's Custom Task Weight value. In our case, we will update the task's custom weight value based on the calculated value in the Total Checklist Items field.
- On the Flow canvas, click on the Plus / Add Element icon below the Start element.
- Select the Update Records element.
- In the new Update Records modal, enter the Label (e.g. "Update Custom Task Weight") and API Name.
- Under How to Find Records to Update and Set Their Values, select Use the taskray task record that triggered the flow.
- Under Set Filter Conditions, for Condition Requirements to Update Record, keep the None--Always Update Record option.
- Under Set Field Values for the TaskRay Project Record, set the following:
- Field = TASKRAY__trCustomTaskWeight__c (Custom Task Weight)
- Value = $Record > Total Checklist Items
- Click Done.
Now that the Flow is fully configured, it is time to save and activate it.
- In the top right corner of the Flow canvas, click on the Save button.
- In the Save the Flow modal, enter the Label (e.g. "Update Custom Task Weight (Based on Checklist)") and API Name.
- Click Save.
- In the top right corner of the Flow canvas, click on the Activate button.
As a best practice, it is always a good idea to test custom automations to make sure that they meet requirements and follow expected behavior. Custom automations can be tested using the Debug options in Flow or in the app, using sample test records.
To test this automation, you can create a task and add a checklist to it. As you add the checklist items, the task's Custom Task Weight field will be updated to reflect the total number of checklist items added.