How to add a Multi-Row Variable set from a record producer to the target table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-10-2022 06:22 AM
Hello, I have a record producer that contains a multi-row variable set. I want the values for this field to be copied over to the record created by the record producer. I was wondering how I can do that. Thanks.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2022 06:09 AM
No I don't want it under description. I want the field to show up in something like variables.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-11-2022 08:30 AM
Hi,
can you share some screenshot of the field where the MRVS data needs to filled in ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-27-2022 05:36 AM
In "What it will contain" section of Record Producer:
Script:
var count = producer.variable_set_name.getRowCount();
var gr = new GlideRecord('custom_table');
for(var i = 0; i < count; i++) {
gr.initialize();
gr.setValue('table_field1', producer.variable_set_name.getRow(i).variable1);
gr.setValue('table_field2', producer.variable_set_name.getRow(i).variable2);
gr.insert();
}
current.setAbortAction(true); // to prevent a empty record creation