- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2019 01:15 AM
Hi Everyone,
We are using an MRVS in one of our Catalog Item. Based on what the user entered on the MRVS, a task should be generated. Question is how can I check if a column e.g. TACAS has a true value in it. If so, a task should be generated. But when a column do not have true value, it won't generate anything. Any suggestions?
Thank you,
Diane
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2019 07:09 AM
I was able to do this using an if script in the workflow. First I get the MRVS in RITM then store it on a variable. Now I will check if this variable contains 'true' then return yes else return no.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2019 01:18 AM
Hi there,
How are you trying to generate a task? Upon submission of your catalog item, thru workflow, run script utility in the workflow? Or business rule? Etc.
If you would use current.variable.your_multi_row_variable_name, this will already provide you with the JSON of the MRVS. Also you could check the generated variables in the sc_multi_row_question_answer table.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
---
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-23-2019 07:09 AM
I was able to do this using an if script in the workflow. First I get the MRVS in RITM then store it on a variable. Now I will check if this variable contains 'true' then return yes else return no.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2020 04:21 AM
We can use this way instead of Glide 'sc_multi_row_question_answer' table .
Here is my working script.
(function executeRule(current, previous /*null when async*/ ) {
var mrvs = current.variables.vendor_information; //variable set internal name
var totalRows = mrvs.getRowCount();
var total = 0;
for (var i = 0; i < totalRows; i++) {
total = total + mrvs.getRow(i).getCell('vendor_price').getCellDisplayValue() * mrvs.getRow(i).getCell('quantity').getCellDisplayValue(); //provide value of variable
}
var req = new GlideRecord('sc_request');
req.get(current.request);
req.price = total.toFixed(2);
current.price = total; //set value on request form
})(current, previous);