REcord producer How to display Multi row variable set data values in the description of the request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2026 03:50 AM
Hi Team, my code is not working and not getting MRVS values in the description of the request using REcord producer Script, could you please review the below code and correct as priority.
Code:
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2026 04:10 AM
hey @GD00609570
Try this :
(function() {
var desStr = "";
function getDisplay(varName) {
try {
if (producer.variables[varName] && producer.variables[varName].getDisplayValue) {
return producer.variables[varName].getDisplayValue();
}
} catch (e) {}
return producer[varName];
}
function addLine(label, value) {
if (value) {
desStr += label + ": " + value + "\n";
}
}
var operationsValue = producer.operations;
var operationsDisplay = getDisplay('operations');
// ---------------- CREATE ----------------
if (operationsValue == "create") {
addLine("Operations", operationsDisplay);
addLine("Details", producer.details);
desStr += "\nCI Details:\n";
// IMPORTANT: Replace 'cmdb_details' with your MRVS name
var mrvs = producer.cmdb_details;
if (mrvs) {
var rows = JSON.parse(mrvs);
for (var i = 0; i < rows.length; i++) {
desStr += "\n--- Row " + (i + 1) + " ---\n";
addLine("Company Name", rows[i].company_name);
addLine("Location", rows[i].location);
addLine("Manufacturer", rows[i].manufacturer);
addLine("Model ID", rows[i].model_id);
addLine("Hardware", rows[i].hardware);
addLine("Description", rows[i].description);
addLine("Serial Number", rows[i].serial_number);
addLine("Management IP", rows[i].management_ip);
addLine("MAC Address", rows[i].mac_address);
addLine("Primary Supplier", rows[i].primary_supplier);
addLine("Secondary Supplier", rows[i].secondary_supplier);
addLine("Maintenance SLA", rows[i].maintenance_sla);
addLine("Notes", rows[i].notes);
addLine("Validation Information", rows[i].validation_information);
}
}
}
// ---------------- UPDATE / RETIRE ----------------
else if (operationsValue == "update" || operationsValue == "retire") {
addLine("Operations", operationsDisplay);
addLine("Details", producer.details);
var cmdbCiDisplay = getDisplay('cmdb_ci');
addLine("CMDB/CI", cmdbCiDisplay);
}
// ---------------- DEFAULT ----------------
else {
addLine("Operations", operationsDisplay);
addLine("Details", producer.details);
}
current.description = desStr;
})();
*************************************************************************************************************************************
If this response helps, please mark it as Accept as Solution and Helpful.
Doing so helps others in the community and encourages me to keep contributing.
Regards
Vaishali Singh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-23-2026 08:39 AM
