Record Producer: Keep previous MRVS rows when dropdown changes, and add new rows as extra columns (o
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sunday
Service Catalog → Record Producer → MRVS (Multi‑Row Variable Set)
Release:
(please add your release, e.g., Vancouver/Washington)
What I’m trying to do
On a Record Producer, I have a dropdown (select box). Based on the selected option, I populate a Multi‑Row Variable Set (MRVS) using an onChange Client Script.
My requirement is:
- When the user changes the dropdown again, the previously inserted MRVS data must remain, and
- The new selection should append additional data:
- Option A: Add the new data as additional columns to the same MRVS (if possible)
- Option B: If columns can’t be created dynamically, then show one more MRVS and keep all MRVS rows together in the same request submission
Finally, submit everything in a single request.
What I already do
- I populate the MRVS rows on dropdown onChange using client script (g_form) with JSON.
- The MRVS repopulates correctly for the current selection, but when selection changes, previous rows are lost.
- I’m looking for a clean pattern to merge previous rows with new rows and guidance on columns vs extra MRVS.
Questions
- What is the recommended pattern to retain previous MRVS rows and append rows for the new selection?
- Can MRVS columns be added dynamically at runtime? If not, what is the best design (single MRVS with superset columns + conditional show/hide, or multiple MRVS)?
- Best practice to merge MRVS JSON values on client side (without server round‑trip) and to load option‑specific rows via GlideAjax when needed?
- Any caveats for UI Policies / Catalog Client Scripts with MRVS JSON?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Sure, Brad
Thanks,
Azeez.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
Simply create onChange client script
1) Get the current MRVS value i.e. JSON
2) then append your new JSON object to array of JSON objects i.e. previously retrieved value
3) Then set that
what did you start with and where are you stuck?
check this blog
Few Scenarios on MultiRowVariableset(MRVS) for Catalog and Record Producer
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
I am working on a Record Producer where I have a dropdown field, and based on the selected option, I populate a Multi‑Row Variable Set (MRVS). The MRVS loads correctly for the first selection, but when the user changes the dropdown, the previously added MRVS rows disappear because they get overwritten. My requirement is to retain all previously added MRVS rows and append the new rows whenever the dropdown value changes, so that nothing is lost.
I also understand that MRVS cannot add new columns dynamically at runtime, so if expanding columns is not possible, I am fine with showing another MRVS for the second selection while keeping all MRVS data together in a single request submission. Currently, I am populating MRVS using JSON with g_form (the standard way of handling MRVS values), and I plan to use Glide Ajax to fetch data from different tables for each dropdown option.
I would appreciate guidance on the best approach to retain previous MRVS rows, merge or append new rows, and manage this setup cleanly using UI Policies or Catalog Client Scripts. Any recommended pattern or example would be very helpful.
could you please check my requirement once Please.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
the link I shared should help
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
yesterday
HI Ankur, thanks for your Solution,
Let me review this in detail and get back to you shortly.
Thanks,
Azeez.
