 Hello everyone. I am Sanjay Gupta. I welcome you on Sanjay Gupta Tech School. So today we are having day five of Salesforce Omni Studio Bootcamp session. And I have Abhishek with me. Welcome Abhishek on the platform. So Abhishek will be delivering some more examples in front of you related to data rector. And if we have time, so we will be discussing about transform as well. So I hope till now you have followed all the session starting from day one to day four. And you have done lots of practice related to data rector. So today we are going to have last session of data rector. And from tomorrow onwards we will be starting IP related session that is integration procedure. Right? So with this... Sorry to interrupt Sanjay. We will be having one more session on data rector load tomorrow. So IP will start. Okay. So got it. So right now we covered data rector export, data rector turbo export. And we will be covering transform today and then data rector load is pending. So one more session will be there for data rector tomorrow. And from next week we will be starting IP. Thank you Abhishek for correcting me. Okay. So with this like we are moving forward. So Abhishek there might be some new folks joining today's session. So please introduce yourself once again so that people know like what you have done and what you are doing for the community and for yourself. Yeah. Thank you Sanjay. So hi everyone. I hope you all are doing well. So myself Abhishek and I am working as a Salesforce and velocity developer in Salesforce community. And I have overall five plus years of experience and I am a trailer double star ranger and I am also I am holding some certifications from Salesforce which is first is like Ognie studio developer for which we are doing all the trainings. And then I have specific specialist service cloud period one and admin and I have done several projects on velocity slash Ognie studio in my previous working tenure. So yeah. Okay. So with this note we are moving ahead. So if you want to become part of a community where lots of freshers are connected and helping each other so you can scan this QR code and you can join this group telegram group. Okay. And if you want to receive timely notification you can follow Sanjay Gupta Tech School on YouTube, LinkedIn, Instagram and telegram and session tracker link is available in the video description where you will find all the session links together. Okay. And please provide some feedback or reviews so that we can improve and like we can have some motivation with your words. Okay. With this note like Abhishek just quickly recap whatever we have done for data rector and what we'll be covering today. Over to you. Sure, Sanjay. Thank you. So in data rector as we have already seen we have four types of data rector. The first one is data expert turbo extract then we have data rector extract and then we have data rector transform and data rector load. So in our previous sessions we have seen data rector turbo extract and data rector extract and we have seen several examples for data rector turbo and data rector extract where we have fetched the data from single object multiple objects and we have used both the examples like hard coding the parameters into the where clause or the filter criteria and passing the dynamic values from the preview tab. So I'm hoping you all are following all these examples at your end to practice so that you can get more insights about data rector turbo extract and data rector extract and these are some examples of single and multiple objects. So in today's session we're going to see formula tab. I mean we're going to explore more on formula tab how to use formula tabs and how we can filter or how we can leverage the formula tab in the data rector. So we're going to have the examples of data rector. We're going to see this formula tab with the example of data rector extract and after that we're going to see why do we use data rector transform and how we can use the data rector transform. So let me quickly go to my Omnisudio environment where all the things will be gone out. If I go to, okay, if I go to data rector and if I open up any one data rector that we have seen in our previous examples this we can see. In this example what we have done is we are fetching the account records where active is equals to active param and active param is our variable name which is we are passing from the input parameters. And if I go to output we are having the account records active field, country field and the name field. And this account list size from where we are getting this account list size from where we are getting this account list size from the formula tab. If I go to formula and I have used this list size formula I'm counting the number of account records that we have got it that we get from the data rector. Like if I go to preview and if I click execute right so as you can see with the yes active we have four accounts in my Omnisudio environment and I'm getting the list sizes four and if I change the yes to no right and if I click again so I'm getting 21 records with no active account right. So this can be one of the example where we can use the formula tab. Now let's see another example right. So for using another example what I'm going to do is I'm going to clone this data rector. Let's give it a name as let's say again data rector account records with formula, save button. And now I'm going to say give me all the accounts where active is not equals to blank or null right. And I'm going to delete the formula that is not been used anymore and from the output this mapping is not required so I'm going to delete it and if I go to preview this input parameter is also not required because we have our hard code in the null value and if I click the execute so I'm getting all the accounts where active is not equals to null right. So I'm getting total of 25 accounts and as you can see we have account list size as 25 right. So now what we're going to do is with the help of formula tab with the help of formula tab we're going to filter out all the account with the active is equals to null right. So we are not using the filter criteria. We will be filtering all the records in the formula tab so before going forward I just want to show a Salesforce developer guide which is giving us all the formulas which can be used in the formula tab of data record right. So Sanjay I think you can share this link with all the folks joining in. Yeah so I already placed this in the session tracker and I'm pasting this link in the chat as well so that anyone who is interested they can copy. Yeah so let's say for example we are having these type of operators in the formula tab and are greater than greater than equal to less than equal to not equal to right and we have string operators as well like like not like and this insensitive comparison like if I want to compare this capital ABC with a small ABC then it will return true. So this operator we use when we don't want to use the case sensitive things and we have all the mathematical operators then we have functions right. So for example if you want to use a function where you want to add a day on a given date right. So the point of or the purpose of showing this developer guide to you so that you can look around because we cannot cover all the functions in the session. We're going to see only one or two examples. So but later on you can go to this developer guide and you can try any functions that you want to try in your formula tab right. So for our example where we want where we are getting all the accounts where active is not equals to null and I just want in my output the all the accounts with the active is equals to no right. So for that what function we can use is we have we have a function called filter okay. So if I go if I see the example of filter right the description says filter a list of JSON objects and return the subset of matches specified conditions right. So if you go here in the example as you can see we are using the filter and we have a list of list of JSON right and in the later part we are seeing where last name is equals equals to Smith okay. So we also have a similar kind of requirement right where we want all the accounts with the active is equals to null correct. So if I copy this one and let's say I'll create okay I'll create one more we want to use the filter right and in the filter what we can we have to do. So we are getting all our results into this account records node right. So we have to use we're going to say list and whatever records that we are getting into the account records right we have to convert it to the list and then in the later part what we have what we want is. So what this will do is this account records so you can imagine it like a for loop okay. So for example you have got an account list from your SQL query now you have added a for loop right and then one by one all the records will execute in your for loop. So what you can think of till this right till this part you have written your for loop okay. Now what you do in your apex you just pick the theme right so I'm going to pick my theme let's say active is underscore underscore c right is equal equal and if I go to example again right. So if we want to use some sort of string parameter so we have to provide double groups correct now if I go again and I'm going to say no okay so I'll reiterate this formula we have used the filter formula and in the in the filter formula we have used the our account records where we are getting all our accounts into the GCN format and we have created a list of it then in the last bit I have started single inverted comma and I have said where active is equals equals no correct and what I'm going to do is whatever data I'm going to get it from this account from this formula right I'm going to put it into the account records back in that case you don't you don't have to create a okay we will see the example of account records one for now okay like if I go to preview and if I click execute and I'm still getting all the 25 account records right because whatever data that we have filtered right it's coming into the account records one not into the account records that means when you are using the filter formula on your account records which is your original extract output path right this list will not get this will list will not get replaced whatever you will write into a result path that is a list that will be created in newly one okay so if I go to output right and if I create one more let's say account name right and so here we say with this new new list we need to create mapping right correct correct so what I have done is all the mappings I have kept it but I have created one more mapping with the account records one colon name into the account one colon name okay and if I go to preview now as you can see we have two list first is of account and second is of second is of account one and if I go to Jason blob okay Jason blob and if I paste it as you can see the original list is still holding the 25 records but the other another list is holding the 21 records now right so but it's not a good practice to create a new new node every time when you are doing some things on the filter on the formula step so if I remove this one from here right and so now what will happen this original extract output Jason path will hold the 25 records right and then we are filtering on that 25 25 records of list then whatever data we are getting we are again overriding the account record records which was the original extract Jason path okay now if I go to preview and click execute and if I copy this and if I paste over here okay it's getting 5.5 but it's getting multiplied okay maybe I think we need to use different name because in previous formula also we are using new name yeah maybe yeah it could it could be possible but if I go to preview again yeah this time if we see right inside so it is showing 25 records 25 records yeah so 25 originally and then after filter it was showing 21 correct so if you want to if you want to get the if you want to get the list of list of this this list size of this list right so we can add one more formula and we can say give me the list size of account records one right I'm going to say account list size one okay and I will go in the output tab and click this and now if I go to preview there will be there will be two node first is account one second is account list size one and second is accounts or is the accounts so account one is holding the 21 records with the active as known and this account is holding the all the records where the active is not equals to none okay and we can simply change it like if I do this as yes okay so if you remember we only had four records with the yes as you can see we have only four records now and account list size is equals to four right yeah so filter is working sorry formalize working filtering is happening the thing is we need to use new list name I guess because old one is giving multiplied records yeah old one did the multiply of the accounts I mean I can check it later on while that that that got happened but yeah I mean for now we can go with the new filter new listening yeah maybe if you can double check and if we can cover this tomorrow yeah yeah thank you so this can be this can be the one example and if I go to function reference again right another example that we can take is I mean we can use the another example of at day okay so what we're gonna do is in this at day we can give a we can give a specific date into this function and we can give number of days that you want to add to that given given date right and it will return return us the newly created value right so if I if I go to formula right I mean this this this is this does not have I mean nothing to do with the all account records we are just creating one formula which is which can be used later on somewhere other place right so what we can do is like we will click we will search for at day and in this again we can use one more formula which is called as today okay so this today will give you the today date and in the other part we can say add one day to it okay and let's say the result can be new date and again we have to create a mapping of this one to the in the output app right so this new date and if I go to preview and click execute so as you can see we have received received 24th of August correct and today's 23rd it is it is increasing its value by one year so you you guys can also go to this developer guide of functions and whatever functions you want to try on you can just read the description you can see one of the examples as well and you can you can do all the hands on by yourself as well from this function that's so Abhishek one thing the last formula which you created for new date so it is somewhere similar to the formula that we create and flows right yeah exactly because this last formula is not dependent to any object it is independent correct I mean there are some there are some you know conditions so for example if I'll give you the example I have a requirement where I want to see that give me all the accounts which is created a day before today ok so how I will get the how I will get the date of day before today ok so what I can do simply I'll go to the formula right and I can I'll say a day give me the today date and I'll add minus one to it ok so this will give me the date of a day before today right and then I can then I can use this then I can use this date to filter out my account records right like if I go into the preview and if I see the execute as you can see it will give me the 22 of 22nd of hours one days back today correct so this is how you can use some some formulas or some functions which will not be dependent on any of the on any of the objects but it's still do those will be still used for making some business logic or create some business logic yeah I think in form in flows also we create formula and we can use that formula anywhere maybe in data element or in any conditional like decision loop so similarly here we can create a formula and we can use it at you use it as a filter condition as well right yeah right so some Ram is asking formula result path any naming convention we can give so formula yeah so from formula result path I mean you should never use like one two you can say like account records list with active no something like that right and it should be in camel case right yeah it should be in camel tools yeah I hope some Ram this answers your question yeah so this is there for all the formulas I mean you can you can try multiple formulas by yourself and if you please any sort of issue we can cover those formula into the next session yep I think with the help of this demonstration guys can implement other examples so if you can show the slides so their examples are available yep yep so guys three examples are available and first is already explained so next to you can try yourself and if you see any challenge so in any of the session you can raise your concern so we'll try to resolve that yeah moving forward so I think Sanjay that we have already covered how to use data extract with the help of input param so do you want me to explain one more examples example around it maybe if you can open any previous example and just walk us through yeah sure yeah I also remember like in data extract you explain both the things like hard coded value and then you replaced it with input parameter okay I think this is a similar kind of context with account yeah I think you can open this one account with context or context with account I think both are having input parameters yep no I think let's let's do one thing I'll create one more data effort for patching all the opportunities where amount is greater than something whatever value we get yeah perfect and that value we can provide as input parameter correct I'm gonna say data that extract opportunity records right type will be extract input output will be Jason and in the extract Jason path what we can say is we will select the my object from where I want to pass my records then I'm gonna give the extract output path like OPP records where I'm gonna say is amount right it's greater than or equal to whatever amount I'm gonna give it on the input input parameter screen or the previous screen so let's say the param can be called as amount param okay and if I go to output you're gonna get some values like opportunity records amount and let's call it OPP colon amount let's take one more field can be close rate OPP colon to preview so now if I or now if I execute it this will not give me any any sort of reason the reason is we haven't passed the amount param value right now if I go to I'll create one param which is this amount param and I'm gonna give let's say value is thousand and if I click execute it will give me it will give me all the opportunity where the amount is greater than equals to thousand right and for example now if I want to do is like let's say twenty thousand and if I click execute might will give me all the opportunities where amount is equal amount is greater than equals to twenty thousand right so I mean each and every time where we when we want to fetch the opportunity records with some filter criteria on the on the opportunity on the on the on the amount value on the opportunity object right then we don't have to change it from extract step we can just simply pass the whatever value we want to pass it to the query we can pass it from from here so this is the biggest benefit of using the data after so I mean whenever you you are using the input parameters right then this data after can be called from multiple IPs multiple integration procedures multiple multiple is correct so let's say if you are hard coding the value over here for example that the example that we saw in the first example the thousand value if we hard code it over here then I cannot use it use this data after multiple on the multiple integration procedures because it will always give me the value or the opportunities where amount is greater than equals to thousand but if I'm using this amount pair then this amount pair up I can pass it from integration procedure rather than hard coding over here so this data after can be used from multiple IPs from multiple omni scripts where we will be passing just this value and this data after will give us all the opportunities whatever value we will pass it from the IP or the omni script so this is the biggest benefit of benefit of using the input parameters or the dynamic parameters yep I think it is helpful and if I'm not wrong in real-time projects I think we need to apply this approach instead of hard coding yeah and if we use omnis to sorry this data after with integration procedure so I think this input will be receiving this data after will be receiving from IP right so we will be we will be passing this parameter from IP I mean wherever you will be using this data after you will be passing this parameter from that source right and if I relate this with flow so in flow we generally create some input variable which is known as record ID right so whenever we place that screen flow we need to pass that record ID so it is generally fetched from that particular record page so I think it is similar kind of thing so for testing purpose right now we are passing the values but if we are using this data after with any of the tool of omni studio so through that tool it will be receiving some input values yep and there is another benefit of using omni studio tools is that not like if you're creating a only studio data after then you must be thinking you can only use it into the IP you can only use it into the omni script or the flex card but that is not the case you can even use this data after with the LWC components with the apex classes as well okay so data after directly we can use in LWC correct this is something great so I mean sometimes what happens there is some functionality which is not which can which cannot be implemented with the help of omni script so we generally go with the approach with the approach of LWC right we just create custom LWC but my my technical architect or my team lead is saying you can go with the approach of LWC but you cannot create a apex class to get the data okay right so in that case I will still create the LWC because my functionality cannot be implemented with the help of omni script but for fetching the data for saving the data or doing some business logic around it I can still use the data rector and call it from the LWC yeah I think it is understandable yep if I go back to the slides and another thing that we're going to cover in the today's session is data after transform okay so we are sorry we generally use data after transform wherever so I mean I'll go to the example only for example you have used your data rector extract and you are receiving all your data into the OPP node then you have the close that and then you have the amount right so for example you are using this data rector from an IP where the period node if I'm using this data rector into the IP I'll receive that I'll receive all the results into the OPP node right but my omni script is expecting the output into the opportunity node not in the OPP node right so for for these sort of things when you want to when you want to change the key key part of the json or the value part of the json for example you have received your data from your data rector extract now if you want to change the key part of this that json this close date is the key part and this date is the value part of this json correct so if you want to change any one of them you can do it with the help of data after transform now we're going to go and create one data after transform new and for creating the data after transform the naming convention is data rector transform drt so I'm going to say is let's say opportunity records transform the opportunity records correct and in the interface type I'm going to say transform and input json input and output type will be the json okay so as you can see in the data rector transform we don't have the extract step we only have formulas we have only have transforms options and preview right why do why don't we have the extract step into the transform because data rector transform only used for transforming or the changing the naming naming conventions of either the key part of the json or the value part of the json right so if I go to the this up the area opportunity records so I'm going to copy this output okay and I'm going to again go to the the drt transforms and so here we don't have any sort of any sort of extract step correct so for using the data rector transform you will be always passing the passing some sort of json right so if I go to transforms in the input json I can paste I mean this is this is just for testing purpose right so whatever data so what will be the general scenario is in your IP you will be you will be calling your data extract where you will be getting your data from like right now we are getting the opportunity data and in the same IP you will be calling your data rector transform okay so from the first data rector extract you will be getting the opportunity records and whatever data you you are receiving from the data rector extract you will be passing it to the data rector transform so we can assume this this data rector extract opportunity records has been already called from your IP and whatever output is coming from this data rector we are passing this output to this data rector transform and for the testing purpose we can just copy all the whatever data we have received from the data rector extract and paste it over here and if I go to quick match so as you can see in the input mappings I have two things OPP OPP colon amount OPP colon close rate right now formula tab we have already seen how we can leverage the formula tab like if if you again want to do some sort of filter sort of thing you can simply do like this use the filter then use the list right then pass OPP over here because your list name is OPP then in copper then we will be using the comma and then here we're going to say amount is greater than equals to let's say thousand so formula tab functionality will be the exact same so I mean I'll just return this formula just to tell you like formula tab is similar so I'm going to delete it so now I will go to Abhishek here whatever we are passing as input in this transform so formula will be filtering that data right correct if we use that filter function correct so basically in data rector transform there is no extract step so you will not be getting any sort of value from the apart from any of the object you will be just giving some input to this data rector transform and you will be getting some output from this data rector transform and why do we use why do we use data rector transform just to change that either the key part of the JSON or the value part of the JSON ok ok so right now what we're going to do is we're going to change the key part key part of the JSON so if I go back to the transform so what we're going to say is for this amount amount we're going to call it as opportunity amount so I am changing the key part of this JSON ok so I'm going to click this plus icon and I'm going to say OPP colon opportunity amount right and in the input JSON I'm going to select OPP amount so whatever input JSON will be having as key so all those will be available here in input JSON path automatically current and now if I go to preview right as you can see whatever data I have pasted into this input JSON is coming up automatically in this part and if I hit the execute button we have OPP colon opportunity amount ok and close data close data is also not available because we have not created mapping yeah so this can be another use case of data transfer ok if you want to bring your data down let's say your data is giving you 20 fees you don't need all 20 fees you just need two fees then also in that case also you can use the data transfer yeah I think yeah it is it is very useful I think so it basically fulfilling two purposes changing key value so key we understood so how will be changing value part because value will be different for every record yeah yeah so for that what we we have to use this formula got it so if you want to manipulate or play around with the value so we can use this like you use add add days right sort of thing so we have closed it and if you want to modify that so we can use filter correct formula and another another example can be of data replica transform is let's say in your input you are just getting the closed data amount right now you want to get one more field into the each and every node of opportunity as let's say today date ok so what we can do is so first we're going to create a mapping of closed it so that we will receive the closed it also ok so now I am receiving the closed it and opportunity amount both I'll go to the formula I'll say give me the today date and I'm going to call it as let's say today date ok and I'll go to transform in the input json I can simply say give me the give me the value with whatever is coming from today date in the formula and I'll call it as today date into the output and now if I go to preview and a click execute right so with the closed it and opportunity opportunity amount in each and every node of opportunity I'm getting the today date as well yeah that's why it is transform correct so we can trim down data we can change key we can change values and we can add some new values as excellent and it won't be like extracting any data of its own it will be receiving the extracted extracted data from any data raptor and then it will transform and will give data back to any other tool it can be IP or something else correct so that is how it is being used you you will be calling some sort of data raptor extract from your IP and then for transforming your data you will be creating a data raptor transform for your data extract and data raptor transform will work together into one IP right ok so anything else that we need to cover no I think for today it is enough and all the folks can go try out all the functions that we have seen yeah so guys for data raptor as of now we have covered turbo extract first then we covered extract and then we covered transform so one more feature is remaining for data raptor that is load and we'll try to cover that in next session if not possible then we'll be having one more session and data raptor data raptor is the important tool of omni studio because after that IP flex card and omni script they totally depend on the business requirement right so we'll try to explain you all those features with different examples and as you can see everything we are explaining theoretically as well as with the help of demonstrations so now the most important thing is if you do regular practice if you follow all the sessions do regular practice then only you will be able to understand and once data raptor is completed then we'll be moving to IP and while implementing IP so whatever data raptor we have created so those we will be using with IP right so without having knowledge of data raptor you won't be able to understand IP or maybe flex card and omni script right so everything is connected so please do regular practice whatever use cases we have shown there in the slides right and anytime if you see any doubt so you can ask questions in the chat or in the telegram group so we'll try to help you out okay so I think we can end the session here only we don't have any question in the chat so thank you Abhishek for sharing the insights and explaining everything in detail with the help of example it is appreciatable and maybe tomorrow we'll be covering data raptor load and we'll try to finish this yeah okay thank you thank you everyone those who joined session live and those who are watching the recording thanks to you as well see you tomorrow