Today, we are going through the second Salesforce Automation Tool. As we already know that Flows provide a two-point and click automation tool in Salesforce:
- Flow Builder
- Process Builder
We have already done with Flow Builder in our previous Blog. So, You have some idea about Flows if you read our previous blog (Getting Started with Salesforce Flow). To be a Master in Flow Builder, You need to create Flow for various Business Cases. Now, Let’s dive into Processes and see:
- What is Process Builder?
- Components of a Process Builder
- When Process starts
- Platform Event
- Create a New Process
- When should I use Process Builder?
- When should I not use the Process Builder?
What is Process Builder?
It is the automation tool that helps automate your business process with no code. Process Builder is used to starting a behind-the-scenes business process automatically. It can handle multiple if/else statements and can perform different actions based on the condition. Process Builder automates more things than workflow and provides additional actions when compared to the workflow actions; it is like the next generation of workflow rules. It is a great tool to work on.
Components Of a Process Builder
Every process consists of three things: An Object to trigger, At least one criteria, Take immediate action if the criteria are true.
An Object to Trigger
For record Change Processes, the trigger determines which object the process should run. There is two option when the process runs on selected object:
- Only when a record is created
- Anytime a record is created or edited
At least one Criteria
When the process triggers, it checks that the criteria condition are met or Formulae evaluates to true or No criteria: just execute the actions. If a record doesn’t meet the criteria, the process skips those actions and moves to the next criteria.
We can add actions to the process to do when criteria evaluate to true. Each immediate action executes when criteria evaluate to true and Each Schedule action executes at the specified time.
When Process Starts
When you click on new to create a new process. A popup will appear where you have to enter Process Name, API Name, Description and the process starts when the option has three values:
- A Record Changes
- A Platform event message is received
- It’s invoked by another process
You can easily understand the Record Changes Process and It’s invoked by another process But I know what is going on in your mind. You are thinking about two questions at that time. The first one is what is a platform event and the other one is how to create a new process in process builder. Wait… Wait… One by one, I will clear everything in a few minutes.
The platform event provides the delivery of secure and scalable messages that contain data. You can monitor your systems and enable apps to communicate inside and outside of Salesforce. These events are based on the publisher/subscribe model(Publishers publish an event message that subscribers receive in real-time). If you want to know more about Platform Events then go through the Links given in the Reference Section.
Create a New Process
- Go to Setup.
- From Setup, enter Builder in the Quick Find Box, and select Process Builder.
- Click New.
- For Process Name, type ‘Test Process’. API Name automatically generates. The process starts when ‘A Record Changes’.
- Click Add Object.
- In the Right Window, Select Account from the Object drop-down list.
- For Start, the process selects when a record is created or edited.
- Click Save.
When should I use Process Builder?
- If you want to set many criteria on a single object and if the first criteria are not met then another criterion needs to be evaluated.
- Use a quick action to create a record, update a record, or log a call.
- Records related to the original record need to be updated (think Process Builder has the starting object as Account but updates need to happen on related Contact record).
- Launch a flow
- Send an email
- Post to Chatter
- Submit for approval
- Invoke a process from another process
- Call apex methods
- Send Custom Notification
- Access a Quip(It is a collaboration tool with built-in office suite functionality, including word processing, spreadsheet, and presentation software).
When should I not use the Process Builder?
- Looping is not possible in process builder and you’ll need to use Flow Builder instead.
- It doesn’t support outbound messages. You have to use Workflow.
- There is a maximum of 5 Processes total allowed for in Essentials. If your automation can be done in Workflow Rules, it’s recommended to use this instead.
To sum up, Process Builder is a very important feature in Salesforce. It has many advantages and can be utilized to automate many businesses cases. Process Builder gives the ability to do things that workflows don’t. This is a perfect No Code solution to automate your process. No need to touch any APEX code to automate simple tasks.