
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 09:04 AM
I am trying to figure out if it is possible to access or pass the value of a field on a Record Producer (RP) on the Service Portal to a MultiRow Variable Set (MRVS). I currently have a field on the RP that lets you specify a certain week and the MRVS lets you specify a record for a day of that chosen week. please see the images below:
Record Producer field for selecting a week
MRVS field for selecting a date from that week
currently, I am able to access the RP field by getting the HTML DOM element ID, but I am noticing some inconsistent behaviors when doing so. Is there any way I can access the field directly through some sort of dot-walking? I have tried using "producer.variables.week_ending" to access the field but that doesn't work within the MRVS client script.
I would appreciate your support!
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 09:27 AM
I haven't found an elegant solution to this, but I did come up with a workaround. It takes a few steps but it worked very well for me in the past.
Create a GlideAjax script include and client script on the RP. onChange of week_ending, write that value to a user preference (sys_user_preference) for the current user. Name it something unique... (<RP name>.week_ending).
In your MRVS, call a GlideAjax to fetch the value that's been written to that user preference.
Then for good house keeping, onSubmit of the RP, clear that value from the user preference.
Let me know if this works for you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2020 08:14 AM
Thanks for the links! I tried them out but, it seems to be more focused on the Now Platform view and doesn't work for the SP view.
I appreciate your help!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2020 09:27 AM
I haven't found an elegant solution to this, but I did come up with a workaround. It takes a few steps but it worked very well for me in the past.
Create a GlideAjax script include and client script on the RP. onChange of week_ending, write that value to a user preference (sys_user_preference) for the current user. Name it something unique... (<RP name>.week_ending).
In your MRVS, call a GlideAjax to fetch the value that's been written to that user preference.
Then for good house keeping, onSubmit of the RP, clear that value from the user preference.
Let me know if this works for you!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-27-2020 08:19 AM
At least until there is more of a direct way of accessing the variable, I think this could be the best solution to the problem I was having. I never thought about using the user preference table to temporarily store the value, but it seems to be a good enough solution!
Thank you for your help!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 05:56 PM
You can use the g_service_catalog API:
g_service_catalog.parent.getValue("variable_name")
https://developer.servicenow.com/dev.do#!/reference/api/rome/client/g_service_catalogClientAPI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2023 02:08 PM
Using g_service_catalog API worked! thanks!