 Hello, friends. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So in this video, I'm going to demonstrate two data elements of flow that is data record and update a record. So for demonstration purpose, I'm going to use this example. When account description field is updated at the time of account record creation or application, then we need to update description field of all related opportunities, right? So before starting, let me promote myself. So if you want to follow Salesforce training videos, you can search my name Sanjay Gupta on YouTube and my channel will be there. So you can watch videos, a playlist related to Salesforce and other programming languages on my channel. So do follow it. So now coming on to the topic. So for this implementation, I'm going to create auto launch flow. So you can search flow in quick find. So the screen will be available and you can click on this new flow button if you want to create a new flow. So I'm clicking on this button. So new flow will be created. So I'm using auto launch flow because this process will run in the background. So to implement this flow, I need account ID because I need to fetch all related opportunities. We are going to call further this flow with the help of process builder. So process builder will provide the account ID. So I'm going to create a new resource that is a variable and its name will be account ID. Its data type is text and it will be receiving the ID of the account record on associated on which we need to update the opportunities. Then second resource I'm going to create one more variable that is description. So we need to receive the description on the account record so that we can populate that on related opportunities. So here also you need to check this checkbox as to because this should be available for input. So both these account ID and description will be passed from process builder to flow. Now I'm going to create first this get records data element. So here label is get opportunities. Object is opportunity. So we need to fetch all the opportunities those are related to this account ID. So conditional match. So here we need to search the account ID. Which is equals to account ID provided by the process builder. So opportunities will be fast. Then we need to fetch all the records choose fields and assign variables. So we will be assigning all selected opportunities in the record variable that will be collection variable. So here I'm creating a variable. Its name is opportunity list. Its data type is record. Object is opportunity. Then don't forget to check this checkbox allow multiple values because it will be storing multiple values and done. Right. So this way opportunity list is created now a select opportunity fields to store in variable. So ID is by default selected. I am choosing description also because we need to fill this and when no records are returned set specific values to null. So you can choose this as well. Sorry. Don't choose this one. Click on done. Right. So now I'm going to link this. Now before moving further, we need to put a decision here. Why decision because we need to check opportunity list. Whether it is containing some values or it is null. So check for now. So we are going to check this opportunity list equals to sorry not equals to. So here instead of choosing equal or does not equal to is null. And then we can choose global constant dot false. So if opportunity list is not null, sorry is null is false. Then we are going to do this operation. So I am choosing done linking this. So after this decision, I need to implement a loop element. So that this can be treated. So it rate over opportunity list. Then we need to choose the collection variable that is opportunity list first item to last time to the first option. Then loop variable which will hold single single value. So I'm going to create that one. So it's API is opportunity record. It's it will be a record data type variable. And here opportunity object should be selected and at this time they should be unchecked and done. And again done. So this will iterate. Now we need to choose assignment. So assign description. So here at left hand side. Sorry. We need to select the opportunity record and our description equals our simple description variable. So this opportunity record description will be updated with this description that will be provided by the process builder. And it is on account record. So I'm clicking on done linking this. So for each item in the collection done. I'm also connecting this. So here a check for null. So we checked it. So if it is not null, then it will go here. So let's say I am opening this putting label as not right. So label will be not null. And if a portion at a list is null is false. Then it will go further. It means your opportunity list is having some record that can be processed further. So here in this assignment, this opportunity record is updated. So now we need to put this into another list. So I'm creating one more variable opportunity list to be updated. It's data type is record allow multiple values and it is related to opportunity object clicking on done. So now we need to create one more assignment or assign opportunity record to list. So this way I am adding this opportunity record clicking on done. So this way this loop will iterate. So one by one, each opportunity record will be having description assigned. This opportunity list to be updated will be having all the updated opportunity records. Now when this will be completed, this loop will be completed. We need to put this data element that is update record. So we are going to update opportunities. Then here two options are available use IDs and all fields from record or record collection or specify records to identify record and set fields individually. So we are choosing first one because we have all values in this record collection and I'm clicking on done. So whenever this loop will be completed, this update record data element will be executed. So after last item, this will work. So now I'm clicking on save, clicking on activate. Now moving here, going to create a process builder. So from process builder, we need to pass account ID and description to things. So creating new process. So it's name will be account process. It will run on record change. So from here I'm choosing the object as account and it will run on both record creation and addition. Now I need to add the criteria. So I'm checking description condition account description is null false account description is changed. It's true. So if these two conditions are true, then only we need to fire this process and immediate action will be call a flow and flow name is update opportunities. And here we need to pass two values. So first time going to pass account ID from here you need to choose field reference. And you need to pass the ID of the account. Here we are passing account ID and we need to pass the description as well. So again field reference from here I need to choose account description. So it will be passed and clicking on save and activate. So this way this process builder will pass two things account ID and description of the counter. Now I'm moving to account. So this account you can see having two opportunities. So now I'm going to update description on this account record. So you can see it is not having anything in this. So update description using auto launch flow and I'm clicking on save. It is saved now moving to related list and on related list you can see two opportunities are available here. So I'm moving both so that we can test whether their descriptions are updated or not. This is the details of first opportunity. So here you can see update description using auto launch flow is available. And for another opportunity you can see update description using auto launch flow. So this way when I updated the account record both opportunities description is also updated. So we implemented this with the help of process builder and auto launch flow. So I hope you understood how we can use get record and update record data element along with you also understood or get familiar through this decision loop and assignment. Logic elements which are available in auto launch flow. So I hope you understood whatever I demonstrated in this video with the help of this example. If you want to watch more Salesforce training videos, you can search my name Sanjay Gupta on YouTube and you can follow my YouTube channel which contains various playlists related to Salesforce and other programming languages. So I hope this will help you to learn programming in better way. Thank you for watching this video.