 Hello everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So today we have one more session on Omni Studio. It is day 14 and today we'll be completing Omni script. So like Abhishek will be demoing you how we can connect our Omni script with IP along with data adapter. So once again I welcome Abhishek on the channel. So Abhishek can you quickly introduce yourself so that we can proceed further? Yeah, sure Sanjay. So hi everyone. Myself Abhishek Agrawal and I'm working as a Salesforce and Velocity Developer in Salesforce Domain since five plus years now and I am at a Trailer Double Star Ranger and I have done some certification on Salesforce like Omni Studio Developer, CPG Specialist Service Loud Admin and PD1 and I have done multiple projects around Omni Studio slash Velocity and majorly I have targeted the industries like health insurance, telecommunication and industry CPQ and I have done some projects around Salesforce as well. So yeah that's all about me. Okay thank you Abhishek for this. So next like if you want to become part of a community where lots of folks are already connected you can scan this QR code and if you want to receive all the timely notifications so you can follow Sanjay Gupta Tech School on YouTube, LinkedIn, Instagram and Telegram. Okay and the session tracker link is available in the description and please share reviews and feedback so that we can upgrade our process, teaching, learning, methodology and I know like people are appreciating this bootcamp because in detail we have demoed everything and all credit goes to Abhishek. So today Omni script will be completing then we'll be having three more sessions so that will be like end of that Omni Studio bootcamp and I think if you go through all the sessions so you will be able to clear Omni Studio developer as well as Omni Studio consultant certification. Okay so with this over to you Abhishek so I think we can start with the use case. Yeah so in today's session what we're going to do is we're going to call sorry we're going to call it integration procedure from our Omni script so basically in yesterday's session what we did is we took a user input from the screen which was an account name and we were fetching that account name with the help of data rector and in the second screen we were just updating some sort of values in it like active should be yes or no or if I want to update the name and then we were using a data rector post action to update the data into the data list right so in today's session what we're going to do is we're going to call an IP and in the Omni script we will be taking an input again the account name from the user and in the IP we will be checking if if account is already exist exist with that name or not if that account is exist in the database then we're going to just simply update it any sort of like if I want to update the name or if I let's say I'm going to update the active to yes or yes to no no to yes and if the account is not exist then then we're going to insert an insert that account so basically if I want to yeah I mean like there will be there will be two things that are going to happen first we will be using a data rector extract to fetch the account and in the second data rector post action we're going to insert or absurd an account sorry update the account so it will be a kind of absurd so we can we can do it into the Omni script itself without using the integration procedure but what will happen we will be calling two data rectors from the Omni script and if you want to do multiple backend processes at the same time right then it's not a good practice to use to use different different backend elements in in your omni script rather than you will you we will be just creating one integration procedure and from that integration procedure we can we can have multiple backend processes called out so and the the main use of integration procedure is also the same only I mean if you want to make multiple backend calling callouts at the same time then we generally use the integration procedure so without further ado we're going to move into our trial org and we're going to implement this scenario so as you can all see in yesterday's session we created one Omni script where in the first screen we were taking an input from the user and then we were extracting that account and in the second screen we were updating the account name and the active checkbox and at the end we were just updating into updating it into the database so in today's session what we're gonna do is I'm gonna create a new version first of this Omni script so basically that's also a best practice to create a new version all always because let's say if you want to roll back your changes then you don't have to do it manually again you can just go to your go to your previous version and you can just activate it right so so today what we're gonna do is we don't need this one so what we can do is we can just hide or we can just deactivate this element from the Omni script so what will happen it will be still there but it won't get executed when you will be executing your Omni script right and and we don't need this one as well because we will be taking taking in taking input in the first screen from the user only and we don't need this data rector post as well right now today what we're gonna do is we're gonna call a integration procedure from him so I can just simply drag and drop an integration procedure here and let's say I want to I want to create a new integration procedure okay and so let's let's call it account underscore not sure if I have already created one let's just check it out it's so it's getting loaded yeah so in this integration procedure we are um yeah we are calling a data rector extract so first what we're gonna do is we're gonna create our integration procedure so in the first parameter what we want we will be calling the same integration data rector that we were using yesterday and in the in the param we're gonna we're gonna pass the let's say you know call it as um account name okay so we'll be like this and as a response I'll go to this data rector and in this data rector we are querying our account records right and in the parameter let's say I'm gonna execute abhishek as gts so we don't have anything from here let me go to accounts and I'll just copy one account name so let's extract this account from our data rector we are okay not this one this is the second one and from this data rector we are getting our account record and now if I go here and in the in the parameter let's say if I pass the account name so as a result of that account data rector fetch we must be getting the result which we are not I think we don't need this yeah sorry so we don't need these merge fields here and if I go to preview again if I click execute and from this data rector we are getting the account information right and now what we're gonna do is we're gonna use a we're gonna use a data rector post action so in the ip I'm gonna drag and drop one data rector post and from here I'm gonna pass this one and as an input what we're gonna pass is so whatever I'm receiving as an output from the data rector extract which is above okay yeah and if I open this data rector post action so right now mappings are created with this one account information colon account name too so what we're gonna do is we're gonna just simply copy this thing which is coming in coming as an output of previous data rector and we're gonna I'm gonna explain it to you again so that you will not get confused active and for the id we have the id okay so now if I again go to preview and click execute and as an output of this data rector post action I'm able to get so basically in this ip what is happening first we are calling a data rector extract where we are passing the accounting okay and if I'm getting an account name from here right then um what simply is happening in I mean we are receiving an output from here and in the next data rector what we are doing is whatever output we are getting from here right from the data rector extract we are passing as an input to this data rector post action so if I if I if you go to the debug logs as a output of this one we are getting the id account name in active and as an input of the data rector post action we are passing these same values so that it will it will update into the database right so now the thing is we want to we want to pass our active checkbox or active pick list from our omniscript right so let's go back to our omniscript and from here copy this one and I'm gonna activate this version I'm gonna call this integration procedure from my this account fax account records okay so now what will happen whatever I'm entering in this account name and whatever I'm selecting in this active checkbox right it we will be passing this input these two inputs to this integration procedure okay so what we we're gonna pass it like this so in the in your integration procedure in your sorry in your in your remote properties you can pass the key and the value so for the value what we're gonna say is it will be your step name colon your element name so account name right so this is the element name of this account name too so here also we have to pass the account name too so your step name and the element name right so we're gonna call it as like account name okay and as the input of the other one we're gonna call it as active and again same thing copy this and here we will simply pass the actor because the element name of the second parameter is active so what we are doing is we will be entering some sort of input in these two things and we're gonna pass it to this integration procedure with the help of remote properties okay now I'm gonna activate we will go back to our IP so the input for these two for this IP will be like this if I go to preview first we will be entering the account name and second will be your active correct so I'm gonna say like for testing I'm gonna say as yes so these two things we will get passed from your integration sorry from your omniscript right and now what we are doing is whatever we have passed into our account name is gonna get passed to this to this IP correct and in this IP we are calling this data rector and account name will get passed to this parameter right just deactivated once and whatever so what we what will happen from your data rector right from your data rector now what we're gonna do is we're gonna just receive the id not the name because name we are passing it from the omniscript so we're gonna just get the id from your data from our data rector okay and to this data rector post action what we're gonna do is we're gonna send the account name whatever input we are receiving from the omniscript I hope I'm able to make sense and active again we're gonna pass it whatever we are receiving from the omniscript and id we're gonna pass it whatever output is coming from this data rector so we're gonna call it as id okay now if I go okay active and if I go to this account for now and if I refresh it once so on the details you can see the abhishek sgts1 and active is right now as no and if I execute it from here right so what will happen if I go back here and if I refresh this one your active will become yes right so just to reiterate one once again we are passing two inputs from our omniscript first is account name and second is active okay and this input is gonna get passed to this data rector and we are receiving an id for the account from this data rector and to this data rector post action we are passing the account name which we are which is coming from your omniscript we this active which is again coming from your omniscript an id which is coming from your data rector extract okay so let's say I am entering abhishek sgts test one so if I go to the account list view and if I try to find any sort of account with this name abhishek sgts test one right so I will not able I will be not able to find any any sort of account and that's our goal because whenever I am typing a new name and if I am not able to find any sort of account with this name then we want to insert an account so now if I click this execute button right so it is saying okay so our data rector post action is getting filled right and the reason is if I go to the data rector post action it is saying it is expecting a very it is receiving the name in the form of account name in this node account and capital name right so I am going to execute it again and if I go to the account list view and if I refresh it see we have a new account now right so basically we are entering some input from our omniscript in the ip we are fetching an account with that name if we are able to find it just update it if we are not able to find it just create a new one that's what we are doing right so I'm going to go to omniscript and I'm going to activate this one now I think this this one is the complex complex example first one and it definitely definitely requires some practice because three things are connected together exactly so I mean like Sanjay I'm going to reiterate again yeah so what is right now what we have done is we have created one ip which is expecting an input which is expecting to input first is account name and second is active okay can you can you show that property like it is the sequence of ip like what elements we have there yeah yeah so basically in this ip we have two properties first two elements first is data rector extract and second is data rector post and this data rector extract will give you the account I mean the input we are passing is the account name and output we are receiving is the account id right okay and in this data rector post action whatever id we are receiving from this data rector we are passing it and this account name and this active is coming from your input parameters okay and this input parameter will receive data from omniscript exactly so now I mean like what will happen this two parameter will get passed to your ip it will try to search whether an account exists with this name or not if it and if if account exists it will give you give you the id and in the data rector post action whatever input you are passing account name and active and if you are receiving the id that means that your account is existing then it will update it if it is not existing it will create it okay and what will be there in this response action action one so right now there is nothing but if you want to get something as a response what we can do is remove this one whatever we are receiving as an output of this data rector post okay so I mean like if I go here and if I open this one this account which I created recently the active is yes right now correct so I'm gonna execute this ip again with a no so it should update that account and as a response we are receiving that active is updated to no and if I go to this account and if I refresh it it becomes no so this is the thing that we're gonna see with the help of omniscript now so I'm gonna explain the omniscript execution in two ways first is we're gonna we're gonna execute it from the preview tab and then we're gonna execute it from the home team home tabs okay go to your omniscript again click preview so I'm gonna put in the same name first so that we're gonna get like it will be if it is getting updated or not so call it as update as it is one and I'm I'm gonna select yes now I'm gonna click the next and if we if I go to the action debugger your ip call is getting executed and as an input your as an input we are sending two things active account name and active and as a response we are receiving the response that it is it has been updated with your yes and if I go to account and if I refresh it it will become yes now so that is how you can debug your debug your omniscript from the preview tab and what we're gonna do now we're gonna create so this omniscript has been already added to our home page right so I'm gonna go to home page we have added this omniscript to our own home page yesterday in the fashion so I'm gonna open this open the home page I did get opened yeah omniscript is either inactive oh why the case we have activated the third one in let me refresh it sorry now it is visible and if I type in let's say abhishek sgts one now we're gonna execute a case where an account should get inserted yes next this error will be coming I will explain you why but let's go to the account list view first and try to search with chic assist yes to yeah see we are able to see the new account with the yes value right now a question will arise why that error came right so if I go back to my omniscript and if you remember we added a navigate navigate action yesterday right so let me open that navigate action just give me a second so in this navigate action in the record id I mean navigate action will look for an id parameter into our omni data json but there is none we don't have id parameter because as a response of this ip right what we are getting is if I execute it as a response of this site ip we are getting this thing so if I go again and if I preview it there's no next so see whatever response you are receiving from your ip it is getting added to your omniscript data json right so if you want to navigate to your account record now you have to update your navigate action with a new node which is this account underscore one colon your i colon your id so I'm going to go to design and deactivate this omniscript and I'm going to update that context id I'm going to call it as so now it is becoming like this count colon this right I'm going to activate it again and from your from our homepage we're going to create um okay we're going to update the record that we created previously it got activated yeah I'll go to the homepage again refresh it once and for this account as it is test two we're going to update this account sorry this I don't know test two okay both are the test one so we're going to update this account with it is now I'll know so we're going to update it with the yes comes as if I click next okay it's saying this record no longer available why is that maybe we can check in the accounts tab like this record is really available yeah okay the record is available but it's not getting navigated let me check why because yeah it is updated as well two years yeah I'll go to the omniscript again and here we have in this account underscore one colon id we are on the correct one right and as an output we are receiving in account one one so if I open this json in the it is in the json block what is happening right now is it is giving us the output in the array format okay if I go to our omnis our integration procedure in if I click preview and execute it is giving the output in this one first this is an array then there is an object so for overcome this problem what we can do is we will just direct we will just deactivate our IP first and we'll just fetch the id only so I'm going to call it as like give me the id only from from the account post action then account what's what was that field account underscore underscore one sorry account underscore one yeah account underscore underscore one and then we were having the id right if I go to preview again and if I click execute I should get the id yeah now if I go to this one click activate so now as an output of this sorry response of this ip will come will be becoming in will come will be coming into the id only so we can switch it back for the navigate action we don't need this thing right now now because the out response of the ip is coming in this id not only now so I'm going to click activate again and now we're going to test it on the homepage and hopefully it should work you know it might be a bit confusing right now but if you do practice and watch this video two three times then you will be able to understand all the concepts at the beginning this was too confusing for me as well so yeah there are lots of components now and like we need to remember the names and naming convention somewhere we need to use percent somewhere we don't so yeah that is also no click next yeah see now we are able to navigate automatically it is as no right now I'm going to go to homepage and I'm going to update it once once more with the yes and it should get updated details and it is getting updated right yep so one question like we created omniscript then we called ip in ip we are calling two datareptors so can we call these two datareptors directly in omniscript as well yeah so I mean like as I explained in the beginning Sanjay what the it is we can we can definitely call these two datareptors directly into the omniscript but this is not as a best practice because when you are making a when you are creating an omniscript right then if you are if you are calling your both the datareptors separately in your omniscript then there will be two backend calls first first one for your patch and second one for your update or insert so and this is not good when when you will be having a lot of data to search and all these things so that is why we have created one integration procedure so now what will happen there will be only one backend call and but in that one backend call there will be two transactions right so that is why we have created and created an integration procedure and called it from omniscript okay and one more thing like on left hand side we can see in this navigation account input datareptor then account information so why these all are not showing here and so the reason is we have deactivated them okay so if you click this checkbox hide conditional not this one so basically what will happen I mean if you if you click it click on this one you will be able to sew it into the properties and you can see these are deactivated right okay so they are still part of omniscript but they are not like we are not able to use so basically I mean this is another feature of omniscript if you are not sure whether you will be using this element in future or not so rather than deleting it you can just deactivate it right okay so I think that's all for today's session anything else you want to cover no I think this is a good demonstration for omniscript and if you can showcase these scenarios so if anyone wants to try anything yeah so different different use cases are available here so guys if you want to practice you can take a screenshot and I will make sure like these will be available in the practice exercise document as well okay so thank you Abhishek for this and next we'll be having flex cards so we'll discuss like when to have that session next week okay thank you everyone for joining the session and thank you for like those who are watching the recording and do practice so that you can become expert in this omnis studio thank you everyone bye