logo

NJP

How to create multiple records in with one record producer in ServiceNow

Import · Feb 15, 2020 · video

hi everyone and welcome to the witch doctors guide to ServiceNow today I'm just going to show you a quick video responding to a question on the ServiceNow community which basically asked how can I create multiple records in multiple tables through a record producer and my solution of this is using the flow which I love if you haven't seen me in the other videos so let's get right to it so what about done so basically to show it I am just using the out-of-the-box record producer called create the incident let me show you a stop go so we have a record producer : create incident and what I have done for this case just to show you how to do it is add another variable called great task which is just a basic checkbox so it looks like this so if I check that checkbox I also like to create and he said tasks and connect that to the incident that the record producer is creating and by doing that I'm also using this table some people might not know that they exist but there is extra out-of-the-box table that keep track of all records that has been created through a record producer so here you can see I did a test earlier and created this in sent through this record producer and here you can see some of the other demo data for that a really good table to use to see if something has been created for a record producer for example if you look at the incident record you have no field error indicating that it has been created through a record producer which sometimes you like to do more stuff than if you create it through a normal just create your instant so let's take a look at the flow I basically just create a new flow on is then created so when the record is who creates the incident I want this one to trigger you can of course set up more conditions and so on but just for a demo I just created insert trigger is flow so right now I can't really come up with a good way as a condition up here where we can actually see is it create the two red roses or not so I need to do that the first thing I do so I'm taking advantage of the table I just showed you so do you want to look up in a table and I know that the producer field should be this a record Boozer and the tasks field should of course be innocent that's being created just like you can see here the producer is create incident and the tasks field is this one I can't of course make more like the task type and stuff like that but it feels like if these two match I know it's been created through that one so I also change that I only need to have one so if that table gets really big at least my query will when we find record it won't go through the rest of records to see if there is a match if the account of the lookup is greater than zero meaning we have found one then I actually take use of the get kettle variable that is the baseline fetch variables from catalog items from start my tricky little bit because it says submitted request and if I don't I even have an eccentric right there I think it even said not just trash it and build it from start just you can see so if it's been created but dude this one as well now let's get the variables so we have to get across the net variables get catalog variables and now it says submit the request requested item so sometimes you think okay does it work with the incident well it isn't has variables as well or can't help so we can actually pull it you can see that after I saved it actually didn't say requested item anymore so it's this record and the template is the record producer is named create insert and they receive during or verbals we're only interested in the quit task so if that field is checked we want to create instant task so if the checkbox is right the true so if that's true let's create instant talk so create task and thumbs will link them together and we'll take the instant field and that value should be in there and I'll just add a short description done this is basically what you the only thing you need to do so just hit save I'll activate I guess it just needs to click on activate on enough August double securing myself to have both save and activate so there we go let's go to our pantry item create task is checked for YouTube and submit and we'll get to have the incense so now you can see you have the self-service view if I switch view to default see it doesn't have to late list if I scroll down you can see they actually created two because I have another one I asked showed a colleague how to use their the transform functionality on data peels but here is the test I created through my flow so this is how we can do it if you would like to have a record browser creating multiple records through one record producer so that's it thank you for watching and see you see

View original source

https://www.youtube.com/watch?v=Aeq70eHMUR4