- 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 07:42 AM
Hi,
I believe Flow won't trigger for Record Producer.
Are you able to trigger it against the record submitted via record producer?
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 07:54 AM
Thanks for your response
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-03-2021 08:00 AM
First question are you able to configure flow on trigger of Record producer?
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: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