Accessing other form variables from inside multi-row variable pop-up
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-06-2019 08:38 PM
Hello,
I am having trouble accessing other variables on a form from within the screen to add a row to a multi-row variable set.
If I run an onChange Client Script on a variable inside the multi-row variable, I don't seem to be able to access variables that are not in the multi-row variable.
Here is an example:
If I set the value in the Multi-Row Variable to "Yes", it should be printing out the value of the "Please Print Me" field in a field message, but it seems like I am unable to access it.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎10-31-2020 03:56 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-13-2025 05:28 AM
Hi James,
you can access variables that are not in the multi-row variable set using this method : g_service_catalog.parent.getValue("xxxx")
Please check out this link for more details , it's very helpful https://developer.servicenow.com/dev.do#!/reference/api/yokohama/client/g_service_catalogClientAPI#g...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2025 09:08 AM
Hi James,
This is a old post but I ended up here while looking for solutions to the problem, so might as well share what I found with everyone.
Quoting the solution (that worked for me) from this post: https://www.servicenow.com/community/developer-articles/multi-row-variable-sets-how-to-get-or-set-va...
(Note that this is the solution for anyone that needs this to work on Service Portal, refer to the main post for Native UI)
Step 1.
Create an onLoad Client Script on the catalog item and set "Isolate Script" to False. We will use this to make the form available globally. The script should look like this:
function onLoad() {
this.cat_g_form = g_form;
}
Step 2.
Create the Client Script that will have to use the variables from the catalog item, make sure to set "Isolate Script" to False here as swell.
Now, use this.cat_g_form as you would normally use g_form, for example:
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '') {
return;
}
this.cat_g_form.setValue('catalog_item_field', g_form.getValue('variable_set_field');
}
And that's it! Took me a while to find a workaround but it works like a charm.