In the previous sessions we understood how to create a process using process builder and also what all
the different action types that we have in process builder like creating alerts and creating out a card
updating records submitting records for output we we understood about different action types.
Now as a continuation of that let's understand how to use process builder to configure nested if else
conditions so nested if any meaning multiple if health conditions grouped together.
So how do we configure this criteria.
In fact if this capability of process builder to configure does multiple nested if this is one of the
major features that we have in process builder and also it is an important feature that is not available
in other automation tools for example workflow vocals why we create this workflow runs it is not possible
for us to incorporate this kind of business logic so that that is in process but that is one of the
most efficient and effective tools that we have to solve complex business requirements so to understand
this concept of nested a fence.
Let's consider this straightforward business scenario we are creating an account while the contract
guard gets created.
The criteria is based on the state field that we have in our address.
So if the state is New York then two actions should take place.
One is notifying the account owner and the second is creating a task.
If the state does Georgia then update the field with this value and for all other states notify the
account owner.
So this is what is the business requirement.
So for solving such a kind of a business requirement we need market multiple if statements and that
we can confirm that using process builder.
So go to your developer on create a new process
fill in the details as we are learning I have chosen this name but otherwise and in real time please
give a meaningful name like maybe you can say account creation actions or a notify account owner on
creation of an account or some meaningful name and also a description here at a car changes.
Basically an actual record gets created in the system save and now let's define our object.
It's called and yes the process will is alerting saying that already that is a process that is based
on this object.
So this is a very good information because many times we may be able to flub other new processes are
the criteria that's already an existing process but in our scenario let's leave addresses.
Let's create a new one.
One event Ricardo's created let's define our criteria.
The criteria is if the state is a New York that is our first two criteria.
If the state does New York so let's define our criteria here I've given a criteria a name and I've given
the condition I'll go and billing state equals New York safe.
So our first criteria is define that does.
Once the contract guard gets created that a guard comes to this step.
So the first condition that is Texas if the state is New York.
If the state does New York yes.
Then it goes and execute these actions.
So what does action notify a gun owner.
So let's say notify a gun owner and then choose the email alert.
OK.
There is no email alert existing.
So let me create one and then updated here I have not created that email alert so go to set up email
alerts.
Create an email alert.
And now I am tagging that email alert here.
Save full effect.
We have defined our first criteria.
That is we are checking of the state does New York.
And then we have any immediate action with that.
That is notifying a condo.
So this is this park is handled all Saudi.
There is a second action as well that is creating a task.
So let me also add in action creating a task task for count on it.
And then fill in the details here.
In the assigned to feel I have chosen the type as field reference and I have selected accounts or not
I.D.
So now we have created bold actions that need to take place when the state does New York.
So basically we have handled the first criteria.
That is a first if and then if the account that is created is not New York then it has to go to the
next step.
That is each check if the status Georgia so if the state does not New York then it should come here
and check if the status Georgio
so building state
so overcrowded.
Good idea.
Name a set the conditions are set safe meaning if it is false meaning if it does not New York it comes
here checks if it's Georgia and if it's true then we have delayed action the action is that I made the
feel of that site as W W W at our Georgia dot org.
So basically that is updated a guy
so update Web site
and then that I got typists the Echo but I can't and then the field is Web site
so we have defined the action that needs to take place if the state does Georgia.
So if that is true then it goes here.
Execute these actions if that is false then it comes to the third criteria that is for all other states
then just notify account or not
so basically then that is another criteria here for all states.
To be more precise we can say for all other states begin say no criteria because it comes to this step.
Only if the state does not New York or North Georgia.
Right.
So it comes here to the third criteria.
And if that's true then it will just be the account owner.
Perfect.
So this is how we can figure out a process using process builder.
And we also construct this nested feels.
So the first if if true these actions take place.
The fourth it comes here and for the second if again if it's true then it does this action a false it
goes to the third criteria and if true it executes this action and if false it does nothing.
So this is how we can figure out a nested IF as using process builder.
The only step that is pending is to activate the process for effect and this is a straightforward process
to test it out just create an account card and see if all these actions are happening.