- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 07:33 AM
Hello,
I have a record producer with multiple Multi Row Variable Sets. I need to create a flow, when a record is created from the Flow, it needs to grab all the line items from each MRVS and create a new record.
How can I do this?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 08:02 AM
You can also use after insert BR on your record producer target table
Sample Script below
I assume your MRVS has name and email variable
(function executeRule(current, previous /*null when async*/ ) {
var value = current.variables.variableName;
if(value){
var parser = JSON.parse(value);
for(var i=0;i<parser.length;i++){
var gr = new GlideRecord("tablename");
gr.initialize();
gr.u_name = parser[i].name;
gr.u_email = parser[i].email;
gr.insert();
}
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 08:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 11:11 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 09:27 PM
That was my 1st question and I informed about that.
Flow designer doesn't work on record producer.
So if you cannot do that using flow then use after insert and the logic I shared.
Just use correct field names from custom table and correct mrvs variable set name and the variables within MRVS
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2021 07:11 AM
I have created a flag on my RP and our custom app. The flag is called "Created from RP". When the RP is submitted, I map the fields to the record. I now have a way of triggering a Flow.
Now, from the flow designer, how can I create new records from MRVS?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-04-2021 07:38 AM
If you are unable to get the MRVS variable value in your flow using the Get Catalog Variables you cannot proceed with the Flow approach.
So the final method would be to use after insert BR and the sample script I shared.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader