Add data in new rows in MRVS using on change client script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2023 06:55 AM
I am using a MRVS in which user inputs are recorded. There is a choice field on form named "New portfolio for project".
On change of this field whatever user selects that record should get added up in MRVS. When he selects the value second time, that value should be added up in MRVS in second row and so on.
I have written an onchange client script but it is partially working. When I select the value second time, it gets overwritten in MRVS but it should actually add up in second row.
Any thoughts how we can achieve this ?
Regards,
Shraddha Madye
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2023 12:06 PM
How do I push a new row and insert values in that ? Also how can I hold the current data which was there in MRVS. The data holding part has to be done from client script I believe. Please correct me if I am wrong.
Regards,
Shraddha

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-15-2023 12:11 PM
I would think nicest way would be doing as much as possible in the Script Include. So pass your current MRVS value through the Client Script to the Script Include. Within the Script Include, you can just push the new row to any existing rows.
You are already using a JSON object, pushing data, so I assume you have some knowledge of JSON to achieve this.
Kind regards,
Mark
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field