 Okay, going live. Hello everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So today we are having one more session on Omnis Studio. And for that I have Abhishek with me. Welcome Abhishek on the channel. So Abhishek will be delivering a few more scenarios and exploring like Omniscript. How we can use Omniscript in Omnis Studio. So the agenda is like he will try to connect Omniscript with IP and data rector. So that like bi-directional data transfer can happen. So we will be receiving input from Omniscript will pass it into IP then IP will be passing input to the data rector. And then through data rector responses will be returned till Omniscript. And the same scenario in upcoming session we will be relating with flex cards. So this way you will get to know like how all components will be connected together and then few more scenarios whatever comes in your mind you can implement with the help of those. Okay. So to explain those scenarios I just want Abhishek. So before that Abhishek if you can introduce yourself. Yeah, sure Sanjay. Thank you. So I have driven myself Abhishek and I am working as a Salesforce Velocity Developer in this community since five plus years now. And I have done few certifications around Velocity slash Omnis Studio and some of them are like Omnis Studio Developer Industry, CPQ and also one is from Velocity which was called as Health Insurance Coating. And I have done some certification around Salesforce as well. So yeah that's all about me. Okay. So thank you Abhishek and this is the telegram group which you can join and where lots of folks are connected. So if you want to discuss any Salesforce related thing so you can join this group. And next if you want to share any review or feedback about the bootcamp. So you can do so that like we can know like how we are doing and if any improvement is required or if any suggestions you want to share for any topic or any upcoming bootcamp so you can do that as well. Okay. So I think we can jump on to the scenarios now. So as I already told you like you will be learning scenario where three tools of Omnis Studio will be connected together. So Omniscript plus IP plus DR. Right. So over to you Abhishek please start with us. Yeah. So in our last session what we did is we called a data rector from Omniscript directly. But sometimes what happened we I mean like in a single transaction we want to call multiple data rectors or multiple backend and backend support or some business logic. So let's say if I want to call two data rectors into a single transaction. So if I go by the mechanism of calling DR from Omniscript then I have to drag and drop two data rectors action into the Omniscript. Instead what we can do is we can call a single IP and in that single IP we can call two data rectors. Right. So that would that would be a good performer if we see from the perspective of performance it would be a good performance tool because now in the previous scenario there were two backend calls but now there will be only one backend call. Right. So in the first scenario what we're going to do is first of all from the Omniscript we will be going to read what object what object user want to extract. So we will be creating a pick list where we will give option account or contacts for now. And then whatever value user selects we're going to pass it to the IP and in IP we're going to create we're going to call two data rectors conditionally. If user selects account then we'll call the data rector for account. If user selects contact then we're going to call the data rector for contact and whatever response is getting written from the data rector. We're going to to the IP we're going to pass it on to the Omniscript and in the Omniscript we're going to display the result whatever is coming from the IP. So let me jump on to the. Okay. So we're going to create a new Omniscript first. So let's call it as Omniscript account contact input. And here let's say I'm going to call it as account or I'm going to call it as object and let's say account contact account or contact. And save it. Okay. So first of all what we want to do is we want to get an input from the user with the help of a pick list. So here we can say the step name can be choose object. And in this step we what we can do is we can just drag and drop one. Input field which would be I think a select this one. So this is called a select over here. And in the options I mean like as we discussed previously we have multiple options custom manual and as object. But for now we can keep it as a manual. So we will say account. So again this will have two things when you and label label you can give anything. But I mean like label will be displayed on the UI and whatever thing or whatever value you will type in here it will be saved into the only data Jason that that is also called as only Omniscript data model that we saw in the previous session. And I can I'll click on save and new and second will be our contact saved. And we're going to call it as object pick list. And it should be required if user is not selecting this one then user should not be able to move ahead. Okay. So first of all we will go to the preview and see the UI how it's going to look like. Yeah. So as we as we can see the staff name is coming as choose object. And we have two values over here contact and account if I select account into the data Jason that you can see we have the object selected as account. And if I select contact then it will be coming as a contact. And if I select nothing then it will show me the error the object is required. Now what we're going to do is we're going to drag and drop two things. First one would be I mean like two steps. First one that will show the contact details. Sorry, the account details. Second one would be would be the contact details that would be the contact details. And what we're going to do is we're going to select the contact details. And what we're going to do here is we're going to add some conditions. So whatever value we are selecting into the previous step. Next step will be the conditional step because if you select the account then this step should be visible if you select the contact and this step should be visible. Right. So here I'm going to add a condition where I can say the object should be equals to account. Correct. And for this one we're going to say the object value should be the contact. And if we again go to the preview and let's say I'm going to select the account value now. And if I click next you can see the account step is coming. If I select the contact. Oh, I think I have to refresh. I think I have given the wrong value in it. Conditional. Account is getting displayed. Yeah. Account is getting displayed but for the contact I think there is some. So I have said C O N T A C T that is that is fine. And here what I have said here is conditional object is equals to just check. The space is also not there. Same. Okay. Let's go back. I'm selecting contact. So as soon as I'm selecting the contact the next button is not coming but if I select account that means for account also. Okay. For account is coming but for the contact it's not coming. So spelling is also correct. Object is equals to. Maybe if we can delete and recreate it. Yeah. Strong. Yeah, I mean like this is some sort of. Yeah. So here in Omniscript like these steps are similar to screens that we create info. Right. Yeah, exactly. And inside steps we need to put particular component. So like here you provided this. Something to display. Yeah. Now it is. Now it is coming. Right. Contact. So this is if sometimes if component is not working so maybe you can try and recreate. Now before showing the values into the account details or the contact details what we want to do is we want to fetch the data with the help of IP and DR. So I'm going to go into the action and we'll drag and drop one integration procedure action. So before after the when we have selected the object object value. Yeah. So here we can say simple is like IP underscore fetch account or contact and we're going to create a new new IP for this because it would be IP. We I mean like we can create the IP is in a two ways. First you can go to the IP from the navigation and you can create it or you can directly create from this button as well. Okay. So I think it will open a sub tab now. Correct. Yes. Yeah. So I mean like going to the IP menu then creating a new one that that step have been saved from us. Now what we have to do is we have to pass one input which would be like I mean like what value we have selected into the previous step. So we can we can send it with the help of remote properties or we can send it with the help of San Jason path as well. It is similar to the IP actions that we have. If you have followed us into the IP section, you should remember what is San Jason path San Jason node and all these things. So here I'm going to say send the send the value from choose object and then the value of the object. So we can simply say here is like. Yeah, we can remember like send means we are passing inputs and response means we are receiving some outputs. Correct. So whatever value we have in this note, we are sending into the San Jason node which is called called as object. So if if I show you from the preview, right, what will happen? Account if I click next. Oh, we haven't activated the IP, but I think we can we can still see what what input is going. So as you can see the input is going as object account. Right. Correct. So now what we're going to do is we're going to add two conditional block into the IP. First one is for the account and the conditional formula. So the input that we are passing is this object. Correct. So we're going to say here object should be equals to account. I think double equals to. Yeah. My land. And for the second one, what it should be, it should be contact. So I think this is pretty simple and straightforward. Right. Now what we're going to do is we're going to call two data refters. One is for the account and one is for the contact. Okay. And let's say I'm going to call it as DRE account and let's create a new one so that we do. There will be no confusion. Account fetch. And here what we can do is we've for now we will simply. I mean, like we will be only fetching one record of the account just just for the demo purpose. So we can say here like name is not equals to blank value. And we will add a limit. Let's say which would be one. Yeah. For the output. Yeah. So guys knowingly, we are setting that limit as one. So you might be thinking why it is one because through Omniscript. Sorry. Through a data refter, if we don't have any limits, it will be giving lots of records. And on Omniscript, we can display only one record at a time. Right Abhishek. Yeah. I mean, like we can display multiple records as well, but that will be a, I mean, like our purpose for this scenario is to show the conditionally exhibition. That is why we are doing this one. Okay. But, but if we have bulk data, so that also can be displayed. That can be displayed, but into the other form. But generally what we do is when we have multiple records coming from the data refter, and if you want to show into the show onto the UI, we usually use the flex cards to show. Okay. So that data. Okay. So flex card we will be using inside Omniscript. Correct. Yes. Okay. Make sense. Yeah. So as part of this data refter, I'm saying where name is not equal to null and limit is one and I'm just having the name as output. Okay. Similarly, I mean, like we don't need to pass any sort of input from air. So we can skip that part. And we will do what the contact as well. And if anyone thinks is thinking that this is too fast, I'll be explaining each and every step again after the completion. So this is contact. No, I think those who are following all the sessions, they can. Yeah. Yes. Because what I'm doing into the data refter that that should be on your tips now. Right. So this is context and here again, I'm going to say, let's like last name, not equals to blank value and limit is equals to one. And for this one as well, I'm going to get the last name. And similarly, I'm going to have the output in the name only. And if I go to preview execute, the last name is coming as Sunday. Okay. And into now we have called our data refter correct. Yeah. Now we want to add a response action. So now we have two options to add a response action. First is we can add two response action into this each and every conditional block or what we can do is. We can write our conditional condition into directly into the additional output response and how we can do that. I'll show you. Okay. I'll show you the both options. So if I do this one, if I like response action into each and every conditional block. So here what I can do is in the response action, I can directly pass the dr re account. So if this step will execute this response action will execute. And if I do this one, and for this one, what we can do is simply instead of account we will pass contact. So in this case, we have two detectors call and two response action, which will execute on a condition. But we can optimize this IP in a more sufficient way. And for that one, what we can do is we can create a response action, a single response action. And for that one, what we can do here is we will call it as response. And here what we can say is let's say I'm going to get the name output and what I'm going to say over here is if percent percent are the merge field object is equals to account. Correct. Then give me the output from then give me the output from account colon d re account. So let's go back here. And I'm going to say percent percent this colon d re account. Okay. I think in the back of the account colon d re account. Yeah. Yes. Account colon d re account or otherwise give me the output from the contact colon d re contact. So this is how we can create a formula into the response action so that we don't have to use multiple response actions. And if I go to preview and just for testing purpose, let's say I'm going to do the account execute. The name is coming as null. Okay. And response action. This one is coming. Okay. I think I have made one mistake, which is we I think we don't need this one. The conditional block name that is not required. And now if I go to preview and execute. So the name is coming. And if I do it here is like contact, then it would be like name. Okay. Yeah. Both are working. So just to differentiate it, what we can do here is I mean like because the result is coming in a bit weird form named colon d. So we can say that the result. Yeah. So it would be like result colon d. Okay. So result now it is coming from the contact. And if I do this, it is coming from the account. Right. And I'm going to activate this IP so that we can use it. And if I go here now, and if I go to go back to the design. So in the step, what we can do is we can just have one display text block into both in both of them. And here what we can say is the result which is which will be coming from your IP is result colon name. Correct. And similarly, same thing we can do in the contact as well. So now what will happen? Whatever step, whatever data rector will execute our result is same. The result will always come into the result colon name. Correct. So we don't have to worry about what path we should give over here. It would be always same. So if we are selecting an account, this step will execute and this result will be coming from account. And if we select contact, then this will be coming. Now if I go to preview and if I try to execute it now. I have one question like if we used two responses with one like first conditional block, one response, another different response, then whatever naming convention we use there, those naming convention we need to use here. Right. We need to remember. Right. So basically in whatever from your IP is giving the result you have to use that format into a script. Yeah. So now if I select the account and if I click next, the name is coming as Abhishek the whatever result is coming from your account. And if I select contact and if I click next, the Sanjay the contact name is gone. Okay. So here one more thing you provided result colon name. What if we provide only result? So it should it should so name colon something. Something. No. Okay. So Omniscript will never show that JSON format. Okay. Okay. Because your output is coming in a JSON format. So you have to Omniscript will always show the value part not the key part. Key part. Okay. So we need to use key so that we can display the values if multiple keys are there. So we need to write them in the same format. Separately. Yeah. Separately. Yeah. So that is our first example. And Sanjay if you want, I can reiterate all the things that we have done in here. Yeah. I think quickly you can start from the beginning. Yeah. So first of all what we did is we created a step and that step we have we have a drag and drag and drop one select input from the build panel. And in that in this one, what we have done is we have added two options. First is account second is contact and whatever value we are selecting into this pick list. We are passing the input to this IP with the help of sand response transformations. And if I go to the IP now in the IP what we have done is. Okay. Just a second. So into the IP we have again created to two blocks conditional blocks. First is for account second is for contact. And we have said like if object is equals to account then execute this one. If object is equals to contact then execute this one. Right. And simply we have called some data actor and got some results from the data actor. And into the response action. We have selected this output response and in this output response what we are saying is if object is equals to account then give me the result whatever is coming from DRE account which is this data actor. Otherwise give me the result from DRE contact which is this data actor. Conditionally. And if we come back to our omniscript into our omniscript I have added two steps. First step is account details for which I have added one condition where I'm saying is if object is equals to account then show this one. And if object is equals to contact then show this one. And into each step whatever result is coming from our IP I'm just showing the results in it. So by this one what we are able to achieve is we are able to achieve how to read some values from the pick list. How to pass some data from omniscript to your IP. And then how to implement multiple elements where we want to add some conditional. And where we want to execute some elements which are conditional. And then how we can pass the output from data rector to IP and IP to omniscript. Yep. Correct. And it was very interesting. Now those who are following all the scenario sessions which we are doing in the season two. I think now they can relate why we implemented data rector why we studied data rector first then IP and then now omniscript. So through omniscript like the UI representation is available. So whatever input you want to receive you can whatever responses we are coming you can display. So this makes more sense. So I think with this demonstration everybody will be able to relate the uses of data rector IP and then omniscript. Yeah. So I mean like kind of what we are doing it doing right now is so whatever we did into the data rector and IP sessions where we have executed all the scenarios like conditional block loop block calling DRs calling another IPs. I mean we were we were passing the output always from the preview which is your temporary input. But now we are passing this temporary input with with an actual omniscript input which user is selecting. So basically we are doing the same things. It just that now we are doing all the things in a real time scenario. Right. And that is our end goal. I mean like I mean if we are creating back end and if you're not creating a print and then there is no use of it. Yeah totally makes sense. Both are equally important. Exactly. Yes. So now if I go back to the second scenario for the today's session which is type ahead block. So what is your type ahead block first of all we will understand that for that one let me open one account or sorry contact record and let's say I'm going to open this Sanjay's record and in this one we have a look up to account which is OK. Yeah here we go. So if I select some values in it let's say I'm going to select sgts so whatever whatever accounts where we have sgts in our name that all accounts are coming over here and we can select any one of them. Yeah. Correct. So that sort of functionality we want to build with the help of open script. OK. So I mean like you are typing and with whatever value you are typing you will get the related records similar to that name. OK. So I'm going to go to open script again. So let's create it. Yeah. Before you create the real quick question from Satvik he's asking can we have an IP without a response action. I didn't know. I mean we can have an IP without the response action but use case will be different. Let's say if you if you are if you want to execute some sort of batch class or the batch process from which you don't need any sort of response response back from your IP you just want to execute it and you you just want to forget about it. Then you can create an IP without the response action but if you want some sort of result from your IP then you have to add a response. Yeah. So if Satvik if you are from development background so if I take example of Apex method so whenever we call any method so we have functionality known as return type so if method is doing something and you don't want to return the result of that method from where you are calling so you will be using void as a data type right but if you want to return something from the method you use a return statement so your response action is kind of same. If you want to return some values from IP to any other tool so for that purpose you will be using the response action. Yeah. So let's move ahead Sanjay. Okay. Yep. So we're going to say like type ahead block ahead block save it. Let's say are we going to select some sort of account records select account and there is one thing called in your build parameter which is type ahead block. Okay. You just need to drag and drop that one and let's give it a name like search account and okay and here what we can do here is in this type ahead block so basically if we see whenever we are selecting a value like I have just showed you on the contact we were I mean like selecting the same type so Salesforce is doing some sort of backend call where whatever user is typing Salesforce is getting back the account record with the related name. So similar thing we have to do also. So we have to drag and drop one data rector or IP action so let's say I'm going to go with the data rector so let's drag and drop one data rector action. So if you can see this data rector is contained into your type ahead block only. I mean like if I want this data rector can be outside outside your type ahead block but if you want to use data rector within your type ahead block. I think it is removed. We need to place it again. Okay. I think there's some issues with this UI. So now what will happen? We can just simply create a data rector here. Let's say we're going to say fetch accounts. Okay. And create let's create a new data rector. Okay. Whenever we want to fetch the account records with a similar name this give me a feel of like operator. Correct. Because equals will always give me a exact value account name. So here what I can do is accounts and let's say I'm going to search it on the name. Name like let's say I'm going to pass a parameter from the Omni script which is param. And as an output what I'm going to receive is first of all the account name. And let's say second parameter will be for example let's say I'm going to get the ID. Okay. And if I select this one like this param let's say hgts and if I execute I will receive this much of data. Account records. So data rector is simple. We have used the like operator. And from the Omni script to this data rector we're going to pass whatever we are typing into the this type at block. So for the name is search accounts. So whatever we are entering into this search accounts we want to pass it to the data rector. So let's say if I'm typing something into this search account something like sgts so that will get passed to our data rector and data rector will give us the results. Okay. Now if I go back and click on the type ahead block there is a thing called type ahead key. Now what is this? So whatever value you are giving to your data rector and as a result what you are getting you are getting name and ID. Correct? So if I type in name over here any email. So okay. I'll show you from the preview this one so that it will make more sense. So let's say I'm going to type sgts. So as a result as a result of this what I am able to see all the names. Correct? And for example let's say if I'm going to type ID over here. Okay. It will show you the IDs of those particular records. Exactly. But we will search it with the name only because we are passing the name. Okay. I think there is some issue. Okay. So your key and your filter criteria name should be similar. Okay. Okay. So I have to... So what I can do here is what else we can do? I think on active field, right? In that case like how you will be able to search the name sgts? You will be searching through ID then? Yeah. Okay. So I think in that case like name is preferred because in the lookup we generally use the name field of that particular object. So I think it doesn't make any sense if we choose any other field because standard functionality also prefer that name field that we create with the object. Yeah and I mean like in real life scenario no one is going to search any record with the ID. Right, exactly. So we can change the type add keys to name and then I think this example makes sense. Yeah. And the other thing is I mean like okay what will happen now? Let's say I'm going to sgts and I'm going to select the Abhishek sgts test one. So as you can see in the result you are able to get the name as well as the ID. So whatever results we are getting a data rector so let's say I'm going to add one more value for example let's say active field. Okay. And if I'm going to go here and let's say I'm going to refresh and let's sgts again and I'm going to select the Abhishek sgts. So as a result I'm going to get now active field as well. Yeah. So whatever feels that you are passing from your data rector you will be able to see into your data. So this is the I mean like I mean like this is the far most coolest thing I have seen on the Omniscript that with the minimal configuration you can build a custom lookup filter kind of thing in Salesforce. And in this scenario like this fetch account this data rector you used inside the type add block if we use it outside then also like we won't be able to relate it right. So basically whatever you have into your type add block that will be only data source for your type add block. Okay. So generally we use data rector only because we just need to fetch the data so there is no need to attach IP here so data rector would be okay. Sometimes we have to use IPs as well the reason is let's say if you want to fetch the data from your external system so in that case data rector won't be possible. You have to use IP. Yeah IP can integrate with third party system and then can pull the data. Correct. So that is our second scenario for today's session. Yep I think it was good so both the both the scenarios are very good for them who are following all. So I think now with Omniscript connected with IP and data rector if anybody wants to implement any scenario and their own so they will be able to implement. So guys we will be doing one more session on Omniscript like how we can update the record or how we can connect how we can place lightning web component in Omniscript. So those sort of functionalities Abhishek will be demonstrating and then we will be having one session where he will demonstrate how we can leverage flex card in this. Yeah right. So in the first scenario that you saw in today's session it was missing flex card that's why we were not able to show all the records that we fetch from the data rector but through flex card it will be very easy. We can do it through Omniscript as well but using flex card will be very easy so that we will be and then we will be doing some projects so that some difficult functionalities you will be able to understand. Okay so I think next week all these sessions will be completed. Okay so thank you Abhishek for delivering the knowledge and thank you for joining the session and if you are watching the recording thank you. I hope you are liking all the sessions. Okay thank you. Thank you everyone. See you in the next session.