This blog explains how to send an automatic email to the CC User (Or FYI user) when any field on a Task is updated in Salesforce. Using a simple record-triggered flow, we ensure the CCed user stays informed about important changes without manual effort.
Let’s see how it works step-by-step…
Create CC User Field on Task Object
We can't directly create a field on the Task object. To create a field on Task, we need to create it on the Activity object.
Steps:
- Go to Setup and click on Object Manager.
- Search for Activity in the Quick Find box and select the Activity object.
- Click on Fields & Relationships, then click the New button.
- Select Lookup Relationship, then click Next. Choose User as the related object and click Next.
- Enter the Field Label and Field Name, then click Next, and Save.
Now, the CC User field is successfully created.
Create a Record-Triggered Flow on Task Object
Follow the steps below to send an automatic email to the CC User when any field on a Task record is updated.
Step 1: Go to Setup and search for Flow in the Quick Find box.
Step 2: Select Flows, then click New Flow. Choose Start from Scratch and click Next.
Step 3: Select Record-Triggered Flow and click Create.
Step 4:
- Choose the Task object.
- Trigger the flow when a record is updated.
-
Set entry conditions:
- CC_User__c Is Null = False
- Select the radio button: Every time a record is updated and meets the condition requirements.
- Optimize the flow for Actions and Related Records.
Step 5: Add a Decision element to check whether any field has changed. If a field has been changed, proceed with the flow; otherwise, exit.
Step 6: Create a Formula Resource named HasFieldChanged with return type Boolean. Use this formula to check for changes in relevant fields (e.g., Subject, Description, etc.). Then use this variable in the Decision element:
Condition: HasFieldChanged = True.
Step 7: If the Decision result is True, add a Get Records element to fetch the details of the CC User.
Step 8: Add an Assignment element to assign the email address of the CC User to a variable.
Step 9: Add another Get Records element to fetch the Task Owner's information (if needed in the email).
Step 10: Add a Send Email action.
- Create a Text Template resource for the email body.
- Create another Text Template for the email subject.
- In the Recipient Address, use the email variable you assigned in the previous step.
- Also, create a Task Link Template to provide a clickable record link in the email.
Step 11: Save and Activate the flow.
Now, the Record-Triggered Flow is successfully created and ready to notify the CC User whenever the Task is updated.
Conclusion
With this setup, you can easily notify the CC User whenever a Task is updated—without writing a single line of code. This approach ensures better communication and keeps the right people informed at the right time using Salesforce Flows.
Got questions? Feel free to drop an email to support@astreait.com