Automation tools help us reduce the workload by automating the flows. Assume, we need to add some custom logic based on the prior values of a record but unfortunately, we do not have the prior value check in flows. Now, in Spring 21’ release salesforce, we can add $Record__Prior property to check the previous value of the record in update.
Let us consider if the opportunity Amount is increased by 50%, then we need to notify the Opportunity Owner. Before Spring 21’ release, we don’t have an option to implement in flows. But now we can achieve this in flow using $Record__Prior in record-triggered flow.
Things to consider
- The $Record__Prior variable holds the value for the record before the flow runs.
- $Record__Prior is available in the following flow location where we can read global variables value,
- Action input values
- Assignment values
- Decision outcomes
- Filters and individual field values when creating, updating, getting, or deleting records
Run Part of a Record-Triggered Flow After the Triggering Event
Scheduling actions in Salesforce can be done by Time Dependent workflow, Process builder and Auto launched flows. Auto launched flow invoked by an Apex class, Process or REST API. In Spring 21, we can schedule the record-triggered flow, as we schedule actions using workflow and Process builder based on the record value.
Let us consider a simple example; whenever an opportunity is created a follow up Task should be created and assigned to Opportunity Owner and a notification needs to be sent to Opportunity Owner 1 week prior to the Opportunity close date.
The above scenario can be done by workflow, Process builder. After Spring 21 release, we can implement this scenario using Record-Triggered flow.
Adding Time Schedules
Flow implemented to schedule the email Action and Create Task for an Opportunity
Things to Consider
- The scheduled actions are placed in the queue until the scheduled time to run.
- We can monitor the scheduled action in the Time-Based Workflow Monitor Setup page