- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 11:52 AM
Hi Everyone,
I have a requirement i want the value of mukti row variable set to be captured on a string field in native UI means backend form.
Exampley i have a mrvs set on record producer i want the values of this variable set to be mapped to a string field on the table.
Kindly help with this. scenario
Solved! Go to Solution.
- Labels:
-
Incident Management
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 01:00 PM
In case if you want those to be populated to the field of the same table on which record producer is created, then try utilizing below record producer script.
var mrvs = JSON.parse(producer.<mrvs_backend_name>);
var str = '';
for (var j = 0; j < mrvs.length; j++) {
str += mrvs[j].<variable_1_backend_name> + ' ' + mrvs[j].<variable_2_backend_name> + '\n';
}
current.<string_field_backend_name> = str; // e.g. current.description = str;
If you want this for another table, then you might have to do GlideRecord on that table and populate as per your need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 01:30 PM
In the Script field on the Record Producer, this will copy the contents of the MRVS in JSON format (with a bunch of brackets and parenthesis)
current.string_field_name = producer.mrvs_internal_name;
If you want the value in the string field to look more readable, you could do something like this:
var arr=[];
var mrvs = producer.mrvs1;
var rowCount = mrvs.getRowCount();
for(var i=0;i<rowCount;i++){
var row = mrvs.getRow(i);
arr.push("year= " + row.year + ", choice= " + row.select);
}
current.u_due_date_term_type = arr.join('\n');
Where mrvs1 is the mrvs internal name, and year and choice are the variable labels in the MRVS, and year and select are the variable names in the MRVS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 01:00 PM
In case if you want those to be populated to the field of the same table on which record producer is created, then try utilizing below record producer script.
var mrvs = JSON.parse(producer.<mrvs_backend_name>);
var str = '';
for (var j = 0; j < mrvs.length; j++) {
str += mrvs[j].<variable_1_backend_name> + ' ' + mrvs[j].<variable_2_backend_name> + '\n';
}
current.<string_field_backend_name> = str; // e.g. current.description = str;
If you want this for another table, then you might have to do GlideRecord on that table and populate as per your need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2022 11:07 PM
working thanks a lot
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2022 01:30 PM
In the Script field on the Record Producer, this will copy the contents of the MRVS in JSON format (with a bunch of brackets and parenthesis)
current.string_field_name = producer.mrvs_internal_name;
If you want the value in the string field to look more readable, you could do something like this:
var arr=[];
var mrvs = producer.mrvs1;
var rowCount = mrvs.getRowCount();
for(var i=0;i<rowCount;i++){
var row = mrvs.getRow(i);
arr.push("year= " + row.year + ", choice= " + row.select);
}
current.u_due_date_term_type = arr.join('\n');
Where mrvs1 is the mrvs internal name, and year and choice are the variable labels in the MRVS, and year and select are the variable names in the MRVS.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-29-2022 11:06 PM
working thanks a lot.