How do I access MultiRow Variable set on workflow?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 03:59 PM
How do I access MultiRow Variable set on workflow?
I have tried current.variables.<mrvs_name> - Result: Blank Array
I have tried current.variable_pool.<mrvs_name> - Result: Blank Array
Tried:
var mrvs; var itemID = '<sys_id_of_ritm>';
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(itemID)) { mrvs = ritmGR.variables.access_list; } - Result: undefined.
Running the above query in background script does return proper result.
- 5,704 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 04:02 PM
Hi Hardik,
This article from Brad is a good reference:
https://community.servicenow.com/community?id=community_blog&sys_id=865b5aeddbc023c0feb1a851ca9619f9
Regards,
Raf

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 04:12 PM
Thanks Raf, but this doesn't seems to work. Also tried below mentioned in the article, for some reason it always gives be defined or blank array.
var mrvs; var itemID = '70506da8db002300e69dfbef2996194a';
var ritmGR = new GlideRecord('sc_req_item');
if (ritmGR.get(itemID)) { mrvs = ritmGR.variables.access_list; }

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-16-2019 04:36 PM
Hi Hardik,
Would you be able to provide the error you are receiving?
I tried a simple catalog item with a Multi-Row Variable set with internal name of "mrvs". I added the following line to the Workflow RUN Script activity:
gs.log("MRVS: " + current.variables.mrvs);
And I can see the following entry in the system log:
MRVS: [ {
"name" : "First"
}, {
"name" : "Second"
} ]
If you could share the error you are receiving, it would be helpful.
Thanks,
Manish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2021 03:24 AM
Hi
I am facing the same issue now. Unable to access the mrvs from runscript, checked in logs and got an blank array. Could you please let me know how you resolved this?
Thanks