How can I add data to multirow variable set in an OnSubmit catalog client script?

gjz
Mega Sage

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:

find_real_file.png

OnSubmit Catalog Client script on the catalog item:

find_real_file.png

RITM:

find_real_file.png

2 REPLIES 2

Mark Roethof
Tera Patron
Tera Patron

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

LinkedIn

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!