
- 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-24-2020 09:17 AM
Use below blog to access MVRS field value
https://community.servicenow.com/community?id=community_blog&sys_id=865b5aeddbc023c0feb1a851ca9619f9
Regards,
Sachin

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2020 09:22 AM
Hi Sachin,
thank's for your response. Unfortunately, that doesn't help me in this situation because I am trying to access the record producer's field from an MVRS client script.
Thanks again,
Peter

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2020 10:16 AM
I will suggest you to go with GlideAjax approach.
MVRS variables values are are maintained in sc_multi_row_question_answer table.
You can query sc_multi_row_question_answer table from your script include and call this script include using GlideAjax from your client script.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2020 09:24 AM
It's not straight forward
refer below links for help
multi row variable set and functions from onLoad catalog client scripts
Help on Multi Row Variable Set
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader