
- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
on 04-16-2019 09:00 AM - edited 2 weeks ago
Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
Hi there,
A short article to share knowledge gained about accessing values within Multi-Row Variable Sets, outside the actual Multi-Row Variable Set + Client Side! I noticed multiple Community articles with questions about accessing the values outside the Multi-Row Variable Set, though no happy responses yet. Because we were dealing with something similar, and I found a way today... here to share with you!
Reading multiple topics, looking Goran's great video's, reading Brad's really strong article, still no clue. Though, today somehow... Eureka!Some of you might have noticed, you can access Variables by IO:ec2c131a0f70b380861309bce1050e1b (some sys_id). Hmmm would that be possible for Variable Sets also? Or in this case Multi-Row Variable Sets? Here it goes...
1) onChange Catalog Client Script, really limited, just for testing purposes
(the sys_id is the sys_id of your Multi-Row Variable Set)
2) The result, the value is available!
Obviously, you do have to parse to JSON. This test is also very limited, just a small onChange Catalog Client Script. Though it's a start, a start that could give great possibilities!
---
And that's it actually. Hope you like it. If any questions or remarks, let me know!
C |
If this content helped you, I would appreciate it if you hit bookmark or mark it as helpful.
Interested in more Articles, Blogs, Videos, Podcasts, Share projects I shared/participated in? |
Kind regards,
Mark Roethof
ServiceNow Technical Consultant @ Paphos Group
---
- 27,571 Views
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Mark, This is great.
Is there a way we can restrict the number of rows in multi variable set depending upon a selection made by a user.
We have select box with choice values from 1 to 5. When user selects 2, multi row VS should have only 2 rows, (add button must be disabled after that).
Thanks.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Did someone else get this working? I am having trouble in New York.
Does the catalog script have to apply to the content item or the variable set?

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi there,
Just verified, still works.
Can you share details about your issue? What you've setup, where your stuck?
Kind regards,
Mark
---
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Is there some way to run a client script onChange of a MR variable set variable? I do not see any ability to do this client side.

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Adding my answer here.
you don't need to pass the sys_id of the variable set , simply access the MRVS variable set by that "Internal Name".
var gr = JSON.parse(g_form.getValue('Internal Name of Variable set'));
It will work.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hello Mark,
Thanks for posting this. I have somewhat similar requirement. We want to set the value of one of the field in Mrvs set to a 'Default value' based on the catalog item main variable. I am not able to pull the catalog variable name into Mrvs. Please help me to resolve this.
Thanks,
Achu

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
You can refer this solution which might partially help.
https://community.servicenow.com/community?id=community_question&sys_id=def61f32dbf5dc102e8c2183ca961951
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Hi Mark,
I am not seeing the internal name of the variable set in place of variable name. it's coming blank.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
var gr = JSON.parse(g_form.getValue('Internal Name of Variable set'));
Can you please help me to understand how to proceed after defining the variable "gr" . I'm trying to do this with the OnChange client script.
Regards,
Kruthika
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content