How can I add data to multirow variable set in an OnSubmit catalog client script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 09:54 AM
I need to number the rows in a multirow variable set when the user submits the catalog item for use in server scripts after the RITM is created.
I've created a test MRVS and have searched the community, but what I find has not helped me solve this specific issue and would like some help.
MRVS:
OnSubmit Catalog Client script on the catalog item:
RITM:

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 09:57 AM
Hi there,
What's the reason for mentioning a Client Script for this? Why not doing this Server Side?
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020, 2021 ServiceNow Community MVP
2020, 2021 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2022 10:07 AM
Yes, there is a reason to do this on the client side.
Because it's difficult to report on variables and combine the data with multiple tables, I've created a custom table to hold the variables of the MRVS. When the RITM is created, I run a before insert business rule on RITM to copy the MRVS data to the custom table. However, it is possible to update the MRVS data in the RITM after it's been created and I need to capture the updates in the custom table, but, I don't have a unique identifier to know which row got updated. I would like to create an "on update" business rule on the table sc_multi_row_question_answer but I don't have any way to match the row with the row in my custom table. I would love to be able to get the row_index from the MRVS and add it to my custom table but so far I've not been able to figure out how to do that, so I decided I would create my own rowid in the MRVS and use that in combination with the requested item number as a unique value.
If you have a better way to accomplish this, I'm all ears!