i want to map Mutli row variable set fields with mu custom table

alishamulan
Tera Contributor

alishamulan_0-1746427248016.png

current.owner = producer.owner;
current.type = producer.type;
current.module = producer.module;
current.project = producer.project;
current.priority = producer.priority;
current.state = producer.state;
current.month = producer.month;
current.requirement_date = producer.requirement_date;
current.dev_start_date = producer.dev_start_date;
current.prod_migration_date = producer.prod_migration_date;
current.expected_end_date = producer.expected_end_date;
current.actual_end_date = producer.actual_end_date;
current.uat_date = producer.uat_date;
current.remarks = producer.remarks; this is the script u have out all variables name proper then to its not mappping to my table

5 REPLIES 5

Arun_Manoj
Mega Sage

Hi @alishamulan ,

 

var rows = producer.variables.your_mrvs_name.getRows(); // Replace with your actual MRVS name

for (var i = 0; i < rows.length; i++) {
var row = rows[i];

var gr = new GlideRecord('your_custom_table'); // Replace with your custom table name
gr.initialize();

gr.owner = row.owner;
gr.type = row.type;
gr.module = row.module;
gr.project = row.project;
gr.priority = row.priority;
gr.state = row.state;
gr.month = row.month;
gr.requirement_date = row.requirement_date;
gr.dev_start_date = row.dev_start_date;
gr.prod_migration_date = row.prod_migration_date;
gr.expected_end_date = row.expected_end_date;
gr.actual_end_date = row.actual_end_date;
gr.uat_date = row.uat_date;
gr.remarks = row.remarks;

gr.insert();
}

 

Chaitanya ILCR
Kilo Patron

Hi @alishamulan ,

Refer this

 

https://www.servicenow.com/community/developer-articles/creating-records-from-multi-row-variable-set...

 

 

Please mark my answer as helpful/correct if it resolves your query.

Regards,
Chaitanya

Ankur Bawiskar
Tera Patron
Tera Patron

@alishamulan 

you will have to parse that MRVS JSON, iterate and then create records

check this link and enhance

How to create records in a table from MRVS? 

another way using flow designer in below link

Set MRVS to custom table 

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

@alishamulan 

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader