 Hello friends. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. After watching this video, you will get familiar with workflow rules that are available in Salesforce. So I'm going to demo you how you can do field update using workflow rules in Salesforce. If you want to watch Salesforce training videos, you can search my name Sanjay Gupta on YouTube and you can follow my YouTube channel. So whenever you want to create any workflow rule, so you need to type workflow rule in quick find setup and select this workflow rules option. So workflow rule is a part of process automation so you can automate your operations with the help of workflow rules. So here the description is mentioned like what is workflow rule examples, then each workflow rule consists of some criteria immediate action and time dependent action, then you need to click on continue. So here you can see if you have already created any workflow rule so that will show and it also shows for which object you created and whether it is active or connective, right. You can deactivate your pre implemented workflow rules by clicking on this link. You can add it and delete as well. This is the list view through which you can filter out your existing workflow rules. Now if you want to create a new workflow rule, so you need to click on this button new rule. So as you want to create a new workflow rule, so you need to select a particular object for which you want to trigger this workflow rule. So let's say for example, I'm selecting contact. So whenever I will be creating any contact record or I will be updating any contact record this workflow will be fired so we can also we can also choose this criteria like when we want to trigger this workflow while creating or while updating or both. So I'm clicking on next. So here you can see evaluation criteria that I talked about, like when you want to fire this workflow rule. So let's first enter name of the rule, then we'll discuss about evaluation criteria. So I'm naming it as contact field update. So here you can fill the description about this workflow rule. So this is demo or field update. Then the evaluation criteria is important. So evaluate the rule when a record is created. So this is first option. Second is created and every time it's edited. So this is second option. So remember, if you choose this second option, then you cannot add independent work with this option. And if you want to add time dependent work collections, as well as you want to evaluate your workflow for the record creation as well as its updation, then you can choose third option. Right. So now second says created and every time it's edited. Third is created and every time it's edited to subsequently meet criteria. So in case of third option, you need to read this help text that that is written here. So it is having the content like the rule is evaluated when a record is created. And when a record that doesn't meet criteria is edited to meet criteria. So if we define a particular rule criteria at the bottom, you can see here we need to define rule criteria. So whenever you update your record and after updation, it matches this particular rule criteria, then only this workflow rule will be fired. But in case of the second scenario, whenever you edit your record, suppose you mentioned a particular field in this rule criteria, and you are editing some other field, but still your rule criteria is fulfilling, then also your workflow rule will be fired. But in case of third, if you mention a particular field in rule criteria, and if it is edited to meet the criteria, then only your workflow rule will be fired. Right. So in this video, I'm just demoing this created option in my another video that will be available in this playlist, you will see the difference between second and third option. Right. So I gave you brief idea about these but if you want to understand them practically so you can watch that video. So now if we talk about rule criteria, so here you will be having to option criteria met and formula evaluates to true. So for if you select criteria met, so you can select a particular field and operator and then value. If you choose formula evaluates to true. So here you need to build your own formula. If outcome of that formula is true, then your workflow rule will be fired, otherwise not. So right now I'm selecting criteria met. So here you can see contact related fields are available. So you can choose any particular field account related fields are also available because contact is associated with account, it is having a look up for account. So all related fields will be available. Then user record field user object fields are also available because we have owner field as look up to user on contact. So you can choose any of the field from contact account and user to build your rule criteria. Right. So here. So I'm selecting this one contact lead source. So here you can see this lookup is available. So it, it will show a lookup window from where you can choose available values. So you can choose a particular value. So I chose web from the list that was displayed. So if lead source that is a field on contact is having value as web, then only this workflow will be fired. If elevation criteria is record creation and rule criteria that record lead source field should, should be having value as then this workflow will be fired. Then add filter logic. If you have multiple rule criteria, like first, second, third, you have multiple fields, then you can build your own logic like and with the help of and and all. So here is an example. One and two or three. So this way you can apply filter logic as well. Then after applying this, you need to click on save and next. So here you can see whatever rule criteria and evaluation criteria we implemented. So these are available here. Now we can define two actions immediate actions and time dependent actions. So in this video I'm just defining immediate work collection. In my another video, you can watch how we can set time dependent work collections. So now if I click on this button, so it shows several options which are actions of workflow. So we can choose new task. We can choose new email alert. We can choose new field update. We can choose new outcome message or we can select existing action. So right now I'm choosing new field update, right? So whenever your lead source will be back, so I want to update value of particular field. So name will be update field value. You can provide some description that you want. Now here it is showing which field you want to update. So from here I need to select a particular field that I want to update, right? So let's say I want to update description, right? So I choose description. It is showing field data type. It is long text area. Then here it is showing specify new field value. So it is showing two options of blank value or use a formula to set value. So if you choose this one, so blank value will be set. If you choose this one, so you have to use a formula that will set a particular value. So for text we need to put a value in double quotes. So I'm putting test description, field update through workflow rule, right? So whenever I will be creating a contact record, if the source is web, then description field should be having this text automatically, right? And here you can see one more option is available. We evaluate workflow rules after field change. So this is also important. So let's say you are updating description field and on this field, you have implemented one more workflow rule. So if you want to trigger that workflow rule after the submission. So you need to click or you need to check this checkbox as true. So right now I'm unchecking this because we don't have any workflow rule that is dependent upon description field of contact. Here you can read the help text. It is if this field update changes the fields value, all workflow rules on the associated object are re-evaluated. Any workflow rules whose criteria are met as a result of field update will be triggered. So I hope you understood when we need to check this checkbox as true or when we need to do, when we need to check it as false, right? So now I'm clicking on save. So here you can see we have implemented one immediate action. If you want to implement more immediate actions, you can do that also. Then at top right corner, you can see done button is available. So I'm clicking on done. So this way I have created one workflow rule that is on contact object. So if you want this to work or to trigger, you need to click on activate. So once you click on activate this workflow rule will be available and it will be fired whenever your evaluation criteria and rule criteria will be matching. So now I'm clicking on active. I'm opening one of the app. So that is my university. So I'm opening it in a new tab. So I'm clicking on context tab creating a new record. So here I'm filling first name and sender. Second name is Huta and test. Now here you can see resources available. So I'm selecting is where you are here description is available. So I'm leaving it as blank. So I'm clicking on save. So record is created. Moving to details of this contact. So here's the name. Then lead sources where and here you can see the description. It is filled automatically. That is a test description for field update through word for rule. So this way I hope you understood how this workflow will work. So I created this on contact of the evaluation criteria was when record is created. And then rule criteria was lead source should be equal to web and description will be updated as per this requirement. So if you create one more record without populating lead source as well. So let's say test test to this time. I'm selecting lead source as purchase list clicking on save. So this time you will see description will be blank because work for rule will not fire. Yeah. Here it is. So description is blank because lead sources purchase list. Now if I added this to web, then also your workflow rule will not trigger. Because our evaluation criteria was evaluate the rule when a record is created. So remember this thing. Whenever you create any work for rule. So you need to focus on evaluation criteria like whenever you want to trigger your workflow, whether on creation or updation or on both. So this way you can do this thing. Then if you want to deactivate this work for rule so that it will not fire so you can click on this button. And you can also read this. You cannot add time trigger to an active rule. So if you want to add any time dependent work for action. So first you need to deactivate it. Then you can add this. Right. So I hope you understood this demonstration of work for rule. Keep watching more related videos on work for rule in this playlist. So that you can understand various scenarios related to work for rules in Salesforce. You can also search my name Sanjay Gupta on YouTube so that you can follow my YouTube channel to watch Salesforce training videos. Thank you for watching this video.