 Okay. Going live. Hello everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So this is episode 10 of Salesforce Omni Studio Bootcamp Season 2. And one more time I have Abhishek with me. Welcome Abhishek on the platform. So Abhishek will be delivering few more scenarios related to Omni script. So in last session he discussed like how we can connect Omni script with data rector and IP. So today also he will be demonstrating few more features of Omni script so that you can understand how to implement it properly. Okay. So with this note I hand over to Abhishek so that he can introduce himself and then we'll start. Thank you Sanjay. So hey everyone. Myself Abhishek and I am working as a Salesforce Velocity Developer in this terminated since five plus years now. And I have done some certifications around Velocity as well as Salesforce and mainly the certification around Velocities like Omni Studio Developer and Industry CPQ Developer and also I have Health Insurance Coating Developer and some certification around Salesforce as well. So yeah, that's it. Okay. So if you want to join a group of like a community group of resources, freshers and experienced folks. So you can scan this QR code. So this is a telegram group where more than 4000 people are connected and they are discussing whatever is happening in Salesforce ecosystem. So you can also join and become part of this. And you can share feedback and reviews about the bootcamp through comments on the videos and you can reach out to us if you need more information, more knowledge. Okay. So I think with this note we can jump on to the scenario that we are going to discuss today. So basically in today's session you will learn about OmniScript purely and in previous session Abhishek to explain you like how you can create the records with the help of OmniScript by passing data into IP and data rector. So today you will see how we can get the data, how we can update the data and how we can apply validations. Right. So over to you. Yeah. Yeah, thanks Andhra. So in today's session what we're going to do is in the OmniScript we will fetch data with the help of typehead block which we have already seen into the previous sessions. And once we select an account which will be coming typehead block then we will be providing a functionality to edit that record as well. Let's say if you want to update the name or active field. And after that with the help of data rector post action we will be updating the record into the back end. So until now we updated all the all the records with the help of IP and data rector only by providing temporary values from the preview. But now we will be providing actual values from the UI and we will be using data rectors to update into the back end. Also there is one more thing when we talk about UI or user interface we always talk about validation. Right. So basically these in OmniScript also we can apply some sort of validation on according to business case conditions. So that also we will be seeing in today's session. So let's jump into the org. So first of all we will do the update updation scenario with the help of typehead block and data rector then after that we will do the validation part. I'm going to create a new OmniScript. Let's give it a name like update account record. So in the first step what we're going to do is first of all we will be going to be selecting an account with the help of typehead block. Okay. Let's give the name that step as select account and from the build you can search for typehead block. You can drag and drop this typehead block. So Abhishek mostly whenever we need to get the data so we use this typehead right? Yeah I mean like it depends. If you want to create some sort of functionality where you want to see something like I mean like whenever we select some sort of lookup value on any record. So as we are typing the match records are coming. So if you want to build that functionality you can use that typehead block or let's say if you want to fetch a exact account right? So you can take a text value and pass it to the data rector extract action. So where I'm going to say search and in this typehead block we're going to use a data rector extract action. I mean like this these all things we have already explained to you into the last session. We'll call it as trextract account and I have already created one data rector. I think this one fetch account and if I open this data rector in this data rector we are passing a parameter called param and in that in that param we will be passing the name value. So if you look at the data rector we are saying we are named like param whatever value we will pass and in the output we will get the active field id field and the name field. So this will be param and here we're going to pass the search account. So whatever we will type in into the typehead block that will get passed to your data rector. So till this part we have already done into the last session if we go to preview and just test it out we can do that as well. So let's say I'm going to search for sgps. Okay so as you can see this is showing me the whole json which is coming from your data rector right now. So for fixing that or for I mean like just want I mean like if you just want to see the name value so we can type in the name because our name is coming into the name keyword. Okay so now in the typehead key if I type name then it will show only the name. Let's go back and do the design I mean like preview and let's say sgps. Now it will show only the names from the account and as soon as I select any account in my data json part of OpenScript I can see whatever values are coming from the data rector like name, id and etc. Okay. Now the second part that we will perform is we're going to add one more step into it for editing it and we're going to name it like edit account and I mean like as part of our scenario we will be updating either name or active or both. So we're going to take two elements for name we're going to take the text element and for active we're going to take the select element. Okay and let's say I'm going to give this name as account name and this one I'm going to give account active we have to add the values as well. So in the select element we can click on this add new option and from here we can add the values for the pick list. So this is the I mean like we have added the values manually right now we can do another thing as well. If I select the s object I mean like this one is also have been explained in previous session but if I do like this then also it will show me the values from the account I mean like now we don't have to enter the manual values manual. Okay and let's go to the preview and let's see if we are able to fetch the I mean like if we are able to pre-populate the values which are fetched from your type ahead or not. So I'm selecting sgps and if I click on next so as we can see we are able to fetch the values but these values are not pre-populated yet right. So for pre-populating there are two options that we have first option is we have this default value thing here we can give the path like say name because the account name is coming into the name parameter and if I go to preview again and if I do the all the things again like say sgps and if I click on next now so still the value is not populated. The reason is because this name is contained into the search account block then in select account correct. So I'm going to copy this and put it into the JSON block so that I can copy the key nodes. So first is your select account if I go to name again and select account then colon and then in this we have this search account block colon then we have the name right. Now if I go to preview and do the whole thing again it will show me the values sgps and next okay it's still not able to fetch okay just give me a second so let's see okay it's into the search account. So I think that's the issue not sure but yes I think we have given extra space here now we can see the value is pre-populated for the name correct but I mean like this is kind of a long way of doing it so I will tell you another trick how we can pre-populate the values. So what you can do is you can keep the element name of your wherever you are setting the values which is coming from your data actor so for like name it is coming as name and for active it is coming as active so I have changed the element name of the text properties by name and I am going to change the for the active one also by the active. Now I don't need to give the default value in it like if I go again into the preview and I am going to select the account again and if I click next as you can see the name and the active field are now pre-populated and we haven't given the default values to these elements so what it will do now is it will automatically pre-populate all the values that are coming from your data actor so the only thing that we needed to do is we just have to match the key part which is coming from your data actor to your element names like this is your element name and this is your element name okay so this will be a bit shorter way of pre-populating the values other way also you can do it now what we are going to do is we are going to use a data actor to update the values so it will be data actor post action like we will say the rp update account but let's see if I have a data actor created already or not let's do one thing I am going to create a new data actor the rp update account and in this one what we can do is we will just create the mapping for account and into the fields yeah so now what we have to do is if I go to preview as it is so we have to do the mappings part I will copy so I mean like whatever values we have here it's under the edit account correct so I am going to paste here this and copy this and for the name what we are going to do is edit account name active one we are going to be active for the id id will be coming from this select account correct select account then colon this search account block then colon then we have the id so this is how we have to update the account so basically we have created three mappings and from your omniscript from your omniscript data json we have to do the mappings for all for updating the account record so this is how we have created the mappings into the data rector post action and I am going to copy this data rector name I am going to go to preview and select this one and I am going to preview it again and we will do the final execution of this one now so as gts ok and before that I am going to open that account record as well into the backend so that this is the one yep so for this one we have the active field as no so I am going to what I am going to do is I am going to update the abhishek sgts test one to test two and the active will be as yes I am going to click next and if I go to the actual record now and if I refresh this tab the name may have become the test two and the active value for this one has become the yes right so this is the first part of our scenario so I am like here it I mean like you will not be able to mix I mean like this is not looking good from the preview so what we are going to do is we are going to add this omniscript to the homepage and also we are going to add one navigation action also so that so that we can navigate to the account record as well so for that one we need the account id from our data json we are going to call it nav pk2 account and here record object api name is account and record id will be it will be contained into the this variable into the omniscript and I am going to click the activate version for just I am like just for showing purpose and we are going to add it to the homepage it will take a bit of time because the Salesforce will get take some time to load it at the page and our omniscript name is always update account so it will be created as a LWC into the Salesforce we can search for update account from here it will be visible here in the custom section yeah as we can see we have our omniscript here I am going to drag and drop let's say here let's save it go back yeah now we will do the all the things from here I mean like from preview it was not it was not looks looking it was not looking like a proper functionality but from here we can we will be able to see it so the sss2 is coming as one is coming as two because we have updated it let's say we can update it to three and again the active will be no if I click on next we will be able to sorry to interrupt we were getting the pre-populated value as well correct yes yeah it is updated it is updated and also the active value to know so now I mean like it's it's looking like a complete functionality right so pre-population is optional sorry pre-population of the values is optional right yeah but if we are editing the record then anyhow we need to pre-populate then then only it will make sense so I hope it is clear and according to our second example or scenario we have to show some sort of validation so I mean like the scenario that we have created is we will create a custom field on account called age and whenever it is less than 18 we will show a error message to the user that you cannot further proceed until you are 18 until you are not 18 plus okay so first of all I'm gonna go and create a field on account record sorry account object in that case is I'll take any other value so you need you need number field right yeah I need the number field but when I'm clicking on new this is showing some sort of error just click on that link click here to open this page in I think pop-ups are blocked okay let's do into the classic yeah I think all right correct correct thanks angel so it will be a number field next call it age let's go back to our omniscript and we're gonna update our omniscript accordingly now so we will fetch the age value as well from the account record and we will add one more one more input element into the edit screen and we're gonna add the validation to it first of all I'm gonna add one more mapping into the edit screen I'm gonna make take one more field number field it will be number field and the mapping that we will do is age age in that post action also we're gonna make the mapping for will be edit age now let's just check if the age value is getting populated or not so that our functionality is completed then we will add the validation age will be coming as blank because we haven't given anything let's I'm gonna say 24 now next and our account record should be updated with the age value which is 20 so that is working fine now how we can add a validation so there is a thing called in I mean there is an element called in omniscript called as messaging element okay so what this messaging element will do first of all I'm gonna drag and drop this messaging element yeah the UI is lagging actually yeah maybe you can refresh the page yeah I think I have to do it so we need to replace this after the age yeah I mean like wherever wherever you can place it it doesn't matter okay so what this messaging element does is in the message I'll first of all I'll tell you the I mean like a theory part of it you can add some sort of conditions into your messaging element and according to that conditions you can show some sort of error message wanting message or success message okay so let's say I'm gonna name it as like age age validation let's call it as age validation and message as inline or toast inline will be okay I'll show you both the options no worries first of all we'll go with the inline and then we have two options over here is first is the true part and second is the false part so we'll come back here once we have well we have added this validated expression okay as soon as you will expand this one you can click on this added validate expression and here you can give the conditions like what I want is my age should be always greater than 18 so I'm gonna say if my age is less than 18 okay then I want to show some sort of error okay so let's do it at other way around my age is greater than 18 or not okay so if it is not a greater than 18 then it will go to the false part okay so it is kind of if else if it is correct then success if it is false then it will be required like some some sort of error it will throw correct so basically whatever condition that you will write over here if it is getting success if it is true then it will go to the true part if it is false then it will go to the false part okay I think this is clear now it's up to you when it is true what you want to show you want to show a success message you want to show a warning message or you want to show a comment message if it is false what you want to do success wanting a comment and there is one more thing into the false part requirement requirement is equals to your validation that if this validation is not getting passed you can you cannot move proceed further okay so let's say and in the third column you can give the message let's I want to give whenever my age is less than 18 I'm gonna I'm gonna say age must be greater than greater than 18 and if it is success I don't want to do anything so I'm gonna just click this checkbox active to uncheck okay okay now now there are two parts that we will see again come here and we will see first is the show message as in line and what is requirement success wanting and comment okay first of all we're gonna go with the requirement so if I'm gonna go and preview it so let the account click on next so right now my age is 20 which is pre-populated from the account let's say I'm gonna make the change and I'm gonna do the 17 so you can see there is a message is coming which is which says age must be greater than 18 and if I click on next it will not proceed I'm clicking on next but it is not getting procedure if I do it then also it will come because it is good it should be greater than 18 right okay and this now I'm gonna go to this error is basically in line right because it is coming in the component itself now if I do the toast so there will be again two things dismissible based on and sticky so basically I mean like it's a type of the toast so let's I'm gonna go with the dismissible which will be I mean like went away after two or three seconds so let's go here and again do all the things sgt s next see yeah it must figure out correct so if I do 17 the toast messages coming as a key if I click on next the toast will always come so this is the difference between this toast or in line now other thing is what are these requirement success and warning let's say if I'm go I'm gonna go with the warning okay now in that case what will happen it will show me an error message into the yellow box but it will not stop me moving forward so it will show me the message into a yellow box as a warning sign but if I click on next I will be able to move ahead so the requirement means it is a mandatory validation if you are going with the comment or warning then it's not a mandatory validation okay and that's I'm gonna do this again with the requirement and I'm gonna check the success message as active and let's say all good I'm gonna get that all good you're all set so now what will happen sgt and next so as you can see s I mean like whenever the condition is getting through the messages coming as all good I'm gonna go to 17 the error message will change I'm gonna do 19 the error message will again say all good right so this is this is how you can add your validations into any sort of screen and you can play around the validate expression and then you accordingly you can show the error yeah I think it is very helpful in real-time scenarios also like whenever we want to put some validation I think we can use it yeah and also we're gonna see this thing from the homepage as well so the reason why the reason why I will be showing this functionality from the homepage as well because I mean like I just wanted to explain the I just wanted to you know explain the functionality of Omni Studio that till now you haven't written any sort of code into your or Salesforce or any LWC any apex anything but you are able to you are able to do so many things with the help of just drag and drop things so SGTS I'm gonna select again I'm gonna click next that's I'm gonna give 17 error messages coming so I mean like if you will write this sort of code or functionality with all the condition into your LWC component it will take at least three to four days for a big for a beginner or a immediate level developer but with the help of Omni Studio that you we can do it in like 40 minutes 40 minutes 45 minutes so that's the benefit of using Omni Studio we're gonna complete the updation part click next and age is 21 so I think that's it for today's scenarios yep I think lots of new things learners might have understood and I can see in the chat people are appreciating our efforts so all the Omni Studio credit goes to you because of you lots of Salesforce developers are like learning Omni Studio and like if they learn pretty well so it will be another option for them to apply for the jobs if they are switching for jobs they can add one more skill set like Omni Studio they know and in all the industry clouds I think Omni Studio is needed nowadays so I really appreciate your efforts and I want to thank the community people also those who are like watching the content and having faith in us and appreciating the content I can see one more request from Ramesh he's asking for some interview questions so a thought came in my mind like lots of content is available on my channel but there is no Salesforce mock interview session I have conducted so far so I think Abhishek we can plan some mock interview sessions like we can prepare a set of questionnaire already and then we can go and maybe someone from community we can invite with us right so that sort of new bootcamp I am going to plan so along with Omni Studio we can cover other segments of Salesforce like admin flows we can cover development related things like Apex and LWC right because these are very much important and if we do the discussions and if people are watching those sessions so it will help them to learn like how how to express the answer and how to relate them with the real implementations so we can do both type of sessions like for freshers separate sessions for experienced professional separate sessions so I think that will help the community as well yeah for sure and also like interview questions are available around the internet as well but I mean like those questions don't tell folks like how to answer them yeah so with the bootcamp that you are planning that they will get an idea like with this question these are the touch points that we should tell the interviewer so that will be really helpful yeah because explanation is important and how to express it totally depends like whether you will be hired or not because in interview we hardly get half an hour or one hour time to impress the interviewer so if they will be watching those kind of sessions so I think it will really help okay so maybe from April I can start those things so for Omnisudio again I will trouble you yeah no problem okay guys so we will be having two more sessions one on Omnisudio Omniscript so one more scenario is pending and that that will be related to LWC like how Omniscript we can relate with LWC so that we will do in the next session and other than that one more session will be there in which we will be connecting everything data raptor IP Omniscript and flex card okay so those two sessions will try to complete this month and next month we will be doing the project implementation on Omnisudio so we will be having end to end use case in simple layman terms and then how you can decide like technically what things you need to implement and which tool you need to use which component you need to build so everything we will try to explain okay so those those project sessions will really improve your knowledge because right now you are learning things individually but in the project you will be implementing everything altogether okay so yep this is the plan for future in this bootcamp so I think four to minimum four or maximum six sessions will be there so next month like mid of April this bootcamp will be completed okay so thank you so much for joining today's session guys and those who are watching the recording thanks to you okay thank you Abhishek for your time so we'll have next session soon thank you