with Multirow variable set submit catalog item, need to create one new story record with description
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2023 09:35 PM
Hi Developers,
I have a catalog item that include multi row variable set(include 10 variables), While submitting catalog item i need to create a new Story record in the record description field need to update all the Multi row variables data and variable labels also need to populate.
EX: if the variable label is Type in description field need populate: Type: XYZ.
Can any one help me on this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-20-2023 12:05 AM
As we already know the Labels of variables in MRVS and MRVS is shown in below format
[ {
//1st row
"variable_name1" : "Value of variable1",
"variable_name2" : "Value of variable2,
},
{
//second row
"variable_name1" : "Value of variable1",
"variable_name2" : "Value of variable2,
}
]
In your example shown in screenshot it will be like,
[ {
//1st row
"type" : "container start",
"read_only" : "yes",
},
{
//second row
"type" : "", // this will be undefined as its empty
"read_only" : "yes',
}
]
In above code you can update below line,
grStory.description = "Type=" + parser[i].<type> +' ' + 'Read Only='+ parser[i].<read_only> ;
You can adjust the code as per your need and with best practices.
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2023 11:52 PM
Hi @praveen47
var mrvs = current.variables."MRVS-Name";