 Okay, let's go live. Hello. Hi everyone. I'm Sanjay Gupta. I welcome you all on Sanjay Gupta Tech School. And this is one more session of Omni Studio Bootcamp. And as you know, like we are doing season two and we are learning different scenarios. And prior to this session, like Abhishek did all the session he was in India. Now, this is the first session he will be delivering from Australia. And as I hope you already know, like he's already working on projects which are based on Omni Studio. So now he's working on client-facing role. So I think in the sessions, like he will be able to share more experiences with you. And let's start with the session. So in today's session, we are going to learn about data after load. So before that, Abhishek if you can introduce yourself. Yeah. Hi everyone. I hope you all are doing well. So myself Abhishek and I'm working as a Salesforce Velocity developer. And I have overall of five plus years of experience in Salesforce domain. And I have done some certifications around Salesforce and Velocity. Which is the first one is like we all know Omni Studio developer. And second is industry CPU developer. And other than that, I have done one more industries Velocity certification which is Velocity Health Insurance and some certification on the Salesforce core industry as well. So that's all about me. Okay. So thank you Abhishek. And if you want to become part of a community where lots of folks are already connected and learning about Salesforce. So you can scan this QR code and become part of that group. And if you want to share some feedback, you can write your feedbacks in the comments. Right. And before starting the session, I just want to appreciate Abhishek's effort because in India and Australia, there is five or 30 minutes time difference. So right now in India, it is 530 we are doing the session but in Australia it is 11pm. And like he's sparing some time for you. So ideally appreciate the efforts. Okay, so let's jump onto the topic. So we are going to learn about data rector load. So so far we did like how we can fetch the data. Now we will learn how we can push the data in the org with the help of data rector. Okay, so let's start. Yeah, so so as Sanjay mentioned, like, till now we have, we have, we have done all the scenarios where we were fetching the data from database with the help of data rector extract and data rector extract. But data rectors, there is another type of data rector which is called as data rector load or data rector post, which used to perform the dml operations in the Salesforce ecosystem. And and dml operations like insert, update, absurd. So in today's session, we're going to see how we can insert independent records, like a single account record. And if you want to insert bulk records, then how we can achieve that. And if you want to insert dependent records or objects, like account and contacts, like account contacts and opportunities. And in the case of contact and opportunities, they both will be tagged with our account. So we're going to see these scenarios in practical today. So let's just jump on to the org and we'll start with the first scenario, which is insert and account record. So if I go to data rectors, we create a new data rector where we say data rector post or data rector load, we can say insert account. And the interface type will be load now. And as soon as we change the data rector at the interface type to load, there is another field we'll be showing, which is batch size. So whenever this data rector will get called from the IP or the omniscript in a asynchronous mode, right? Then we can define the batch size, the way we do in the batch classes or asynchronous jobs, right? So it will say that how many records can be processed in a single transaction. So right now we are keeping this as blank. So divide equal to batch size is 200, we all know. And if I click on say, and there is one more thing if you have given a notice. In the data rector extract, we never had the output type as object. But in the data rector load, the output type will always be the as object. The reason is because data rector load are only used for inserting, updating or upsetting records into the Salesforce objects, as objects only. So there will be no JSON output type, there will be no XML output type. There will be always as object output type. So if we insert the, so I mean like our scenario was to insert an account record. So we have to click on the add object. And in the add object, we have to define the object type that you want to insert. So we can simply select the account. And from here, there is a, there is a lock icon will be visible. If you click on this, it will get logged. So I mean like it's kind of a UI thing. If you click on this, then you can edit it. And if you click it, you cannot edit it, it just so that the UI is more comfortable. And formula tab is similar to kind of data rector extract where we, if you want to, I mean, let's say you are passing some sort of input to this data rector. And if you want to make some modification into the data rector me, then you can write down some formulas. And if you go to the options tab, it is kind of similar, but there are some new options like ignore errors, rollback on error, use assignment rule and overwrite target for null inputs. So this fourth option is similar to the data rector extract. If there is any null value, if this checkbox is not checked, then it will not come into the output. And if this one is checked, then the null value get populated. Ignore errors will be like, let's say if this data rector load has been called from the IP. And let's say because of any reason this data rector data rector is getting failed, then that IP will continue its transaction. It will not stop on the data rector call. Okay. And rollback on error, let's say we are inserting 100 records and let's say 99th record will get failed. Then all the records that have been processed within this data rector will get rolled back into the database and use assignment rules. It's a out of the box functionality of Salesforce. Whenever you create a case record, you can assign it to someone. So you can check this checkbox. Now if I go to the fields, in the fields, again, we have two things, input json path. And on the part of output json path, we have a new thing called domain object field. So input json path, we will be always passing the input to this data rector and domain object field. That means in which field you want to map this input json. So let's say if I click on a plus icon and I want to insert an account with the name. Okay. And input, I'm receiving the input in ecc name. We'll suppose that. Okay. And so what will happen? We have to pass this ecc name from the input parameters. And this value will get passed to the name domain object field of account. Okay. So if I go to preview. One thing I want to discuss, if you can go back to this fields. So here input json path name can be anything. Right. Yes. And domain object field is the field which is available on the object. So it should be same on this. Okay. So this should be exact API name of your object. And this is case sensitive. So we have to keep in that also. Right. So if I go to preview now and let's say I'll generate a json, where I'm going to pass the value for account. So let's say as it is a load. DR load one. No. And if I click on execute. This will insert the account. And as an output, it will give me the as object record ID. And if I click on this one. It will open that account record for me. So for this, like if, if one want to create some records through data after load. So they need to know the, like how to write json. Yeah. I mean, if you are into a studio. This is a mandatory skill that you have to learn that how to work with json. Right. So that is there. And so I mean, like, I hope this is a very simple scenario where we have just mapped one field of the account object. And we have passed, we have passed the input parameter. And as an output, we are getting that subject record ID. Right. Right. Now, if I go to the second scenario here, what we want to achieve is we want to insert account records again. But I mean, like if you go to this, there is only one record, one account record, which can be inserted at a time. But let's say this is not a usual scenario, because when we are working with apex, we usually update multiple records addressing in a single transaction. Right. So for that, what we will be doing is sorry. So first of all, okay. So what we know what we're going to do is we will clone this data vector. You'll say insert account records bulk and yeah. So now what will happen? I'm going to call this. So I mean, like when we work with apex, we have any if you want to, you know, insert or update bulk, bulk number of cards, then we have to create a list of it. Right. So we have to do the similar thing over here as well. So for that one, what we're going to do is we're going to say, so let's say I'm going to stay here. I'm going to create a list called ACC list. And as for this one, this is going to be removed. So if you can see, I have created it. If you can relate it, if we have the result of data raptor extract. So the same permit we can use, I think that will be easy for learners. Yeah. Yeah. I agree with you. So I have a data raptor extract where we are passing the name param and I'm going to remove the delete and I'm going to say here, let's say we can choose active or rating. Yeah. Rating is equals to part. Yep. And if I go to preview, we don't need this anymore. Click execute. So I'm able to receive four or five account records. Okay. Yeah. I think but list is not available. This name is not available. It is like independent notes. So we can do that as well. So as part of list, what I'm going to do is I'm going to just create a list for name only so that we'll not use the time. And I mean, whatever I'm trying to do in this data that I hope you all are able to understand. So I think. Yeah. I think one node we can copy and then we can repeat in the data raptor load. Yeah. Okay. So as you can see, there is an account list has been created and in that we have five account records. Correct. So I'm going to simply copy this one and paste it over here. So if you see this Jason format into the apex format, this is your list name and there are five members in that list which have, which are having the name as input parameter. And as a change, what we have to do is we just have to change the only one thing over here, which is ACC list colon name now. So now what will happen when I click on execute, the data, data raptor will automatically understand that this is a list. And in that list, let's say I have five records, I have 10 records, this data raptor will insert those records in this in the graduate show. And as output, you will receive the IDs for each and every account. Perfect. Yeah. So, so I think similar to output mapping and output mapping, we also have list name colon than a particular field. So similarly, now it is input, Jason, right? So input Jason, we are having list colon and then particular field and basis on that we are pushing the data. Correct. So I'm like, if I go back to data raptor extract, that is the same thing we are doing over here. We have created a mapping so that we can have the result into the list format. Right. So this list format, we have to pass it to as an input parameter to data raptor load and it will execute multiple times. I mean like logically it will not execute multiple times, but in a single transaction, it will insert multiple multiple records. Right. Okay. And now if we go to the scenarios again, there is another scenario that we want to achieve here is insert account with related contacts. Okay. So what that one, again, we're going to clone a data raptor and here we're going to say insert account with contacts. So first step will be obviously the account. Second, we want to insert. So we can, we can use a single single data raptor load for inserting multiple objects. So here we're going to say contact. And if I go to fields now, I will be able to see two sub tabs under the fields tab. So one is for the, obviously for the account and second one is for contact, it will, it will create automatically. And we all know for contact, we have to give a, we have to give last name as a required field because last name is the mandatory field on contact. So we'll say contact last name and the domain object field will be the last name. Okay. And if I go to preview, I don't want to create multiple account records. I'll just have one only. So in the preview, I'm going to remove this. We don't need this. Also, and we need this, this as a parameter and another parameter that we want is which is contact last name. So we have to pass this one as well. So here we're going to say first contact. Okay. And if I click execute, it will give me the contact and account records inserted. But there is a catch over here because whenever we are working with account and contacts, right? They, they are the related objects to each other because contact is a child and account is the parent. But right now the contact and the account got inserted independently. They are not related to each other right now. So for, for achieving that purpose, what we, what we have to do, we, we, we have to create a link between these two things into the object step. If I click on this ad link, there will be a new window will get open where in the domain object field, we have to say, so let's say on contact, if you want to connect the contact with the account, you have, there is a field called account ID on the contact that you want to populate. And the linked object will be, so let's say before this contact, I have one account, I'm inserting one account. Let's say I'm inserting two accounts before this contact. So there will be two options, one account and two account. So to which account you want to attach this contact you can select from here. And here you have to give the field which you want to populate. So basically now what will happen? First of all, account will get inserted and after the account will get inserted, the contact will create a mapping with the account ID, with the account ID, whatever account has been inserted over here. So that ID will get passed here and that ID value will get populated on the contact account. Right. And as a result of this mapping, if I go to the contact, there is a mapping created, as soon as I click on the add link, there will be a default mapping will get created by the Omni Studio features. Where if you want to understand the domain object field is account ID and similar thing, get it from the account and what field you want to populate the ID field. And now if I go to preview and let's say one and click execute. And if I go to contact, so this contact will get attached with account. Right. So this is very useful feature of data rector load where you don't have to worry about the IDs which is getting created for the parent object. We can attest those IDs with the child object by the out of the box functionality of data rector load. Okay. Okay. And if we want to insert opportunity as well, so we can have one more section. Right. And then similar way we need to map. Right. Yeah. So for that, what we're going to do is we're going to create a kind of clone of this contact where we will add one more object that will be called as opportunity and we'll create a link with the similar thing. We're going to say account ID. From the account only. Now you can see before opportunity we are inserting two records, account and contact. So this one is showing us two options which one you want to select. Right. So I'm going to say the account ID again here the ID field will be there. And in the fields there will be a third sub tab will get created and the default mapping will get created with the add link functionality. And I think for opportunity I do not remember which is the mandatory field. Three fields, opportunity, name, close date and stage. Okay. So we're going to say OPP name and forgetting the date we can create a simple formula which is today. So this formula will give us the sorry and we can call it today date and for population of this what we can do is we're going to say input json today date and here we're going to say close date and what's the other one? Stage. Okay. So we're going to call it OPP stage and from the preview we now we have to pass two more parameters OPP name and OPP stage. That would be I can process that thing and the other one is OPP name. And if I click on execute it will create the opportunity as well. And if I navigate to opportunity as we can see the account is already populated and whatever fields we populated the name, the close date which is 14th of path and the stage is prospecting. Right. So and if I go to the account again and from the account from the related list I can see the contact as well as the opportunity because both of the objects have been attached with the parent record which is account. So that is a very useful scenarios with data rector load. There are few more scenarios which we can discover but I mean like for today's we have only these scenarios but data rector load is very useful tool of OPP studio by which we can perform so many tricks to update or update or insert the data to the database. Right. So this is the version I have here. So right now these are inserting single, single records. So if we if we want to do bulk update so similar to the previous one we need to create a list and we need to set the data and the mapping will be same like let's name a colon and then whatever name we are using in the JSON then we need to use the same name. Right. And linking will be done automatically. So it depends on your JSON structure. Okay. So let's say you have independent list for account and contact. Okay. Then linking will be done anonymously. I mean any contact can get attached with any account. Right. But let's say if you have a JSON structure where you are we are seeing there is a ACC list and in that ACC list for example we are having nested contact and opportunity list. Yeah. Then it will get attached with the same account for which you want to attach it. And in that case input mapping will be same like account. Let's say list of account name is accounts and inside that we have contacts and opportunities to list. So we need to write accounts colon contacts colon and then the name of the field. Right. Right. Yeah. In that case linking will be like properly with one account proper contacts will be. But if the JSON structure and the list are independent to each other then we cannot shortly say that this contact will get attached with this account. That will be anonymous. Right. Yeah. Otherwise this will be the way like in single like block we can have all the fields available together and we can create as many blocks as we want to. Correct. Okay. Yeah. I think this is it for today. So maybe yeah. So we will be having one more session for data rector in which like we will be covering update and absurd. Right. And we can quickly cover the single scenario on transform also so that data rector part will be completed. Then we can pick the integration procedure. Yes. Yeah. And I think I'm thinking like omniscript and flex card we can do with some scenario because independently we already explained them so we can have an end to end scenario so that it will be quickly explained. So data rector and IP we can explain independently and then omniscript and flex card we can explain with a scenario. Yeah. Definitely. I mean like we'll create a scenario where we will demonstrate how we have achieved and how things are happening. Yeah. So that all all four components will be used together. Yes. Okay. Okay. So thank you everyone for watching this session. So Krishna is saying if it would be very helpful if we come up with a session in future related to how to pass data from OS to omniscript to LWC flex card. Okay. So one session we can do like omnis studio tools and LWC that we didn't do in our previous sessions. Okay. Yeah. Definitely we can do. Okay. Okay. Thank you everyone for watching this session and thank you Abhishek for spending some time and sharing your knowledge. Thank you. Bye everyone.