
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 05:56 AM
Hi,
I have a multirow variable set on a catalog item. In the catalog item, once you select a specific Network value in a variable , i fetch the associated data and displaying them in multirow variable set.
So for 1 specific network, there can be rows anywhere between 5 to 20. In each row, we have 10 fields.
If user has edited 2 rows in these 20 rows, is there an easier way to find out which of the 2 rows are edited?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2019 11:37 PM
Unfortunately there is no OOB Way solution for this.
So here is how i did it.
Create a variable (yes/no) field in a variable set.
Make this variable hidden on add/edit.
Whenever a row is edited, i have updated the edited value to yes.
Then in my workflow on task table, i have fetched all the variables and removed the entries which are not edited. Below is the code snippet that i have used to update the RITM with only the entries that are edited.
mrvs = current.variables.my_varset;
var rowCount = mrvs.getRowCount();
for(k=0;k<rowCount;k++) {
var row = mrvs.getRow(k);
if(row.edit_row!= "Yes") {
row.deleteRow();
rowCount = mrvs.getRowCount();
//reinitialize the counter variable so that it checks again from beginning as the multirow variable set and rowcount gets updated on delete.
k=-1;
}
}
//once all non edited rows are removed, update the multivarset bck to the record.
current.variables.my_varset= mrvs;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 06:06 AM
Hi,
Have a look at the comments in this post:
https://community.servicenow.com/community?id=community_blog&sys_id=865b5aeddbc023c0feb1a851ca9619f9
Not sure if this answers your question directly but it will give you some pointers on how to inspect individual rows etc.
Regards
Paul

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 06:15 AM
Hey Paul,
Thanks for your comment. Seen this article. Did not find any pointers towards knowing which row is edited.
I can traverse each row and compare it with the values in the database, but that would be very complex approach. Just checking if there is any attribute which says edited=true if its edited.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2019 06:21 AM
That would be nice, afraid there isn't. The only way to do this is code and compare I'm afraid.
Regards
Paul

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-13-2019 08:32 PM
what is your use case?
you can use client scripts on multirow variable set to manipulate variables on change.
you can also add an additional field in MRV to store the network variable value from which the rows are inserted. so you can track the rows without issues.