MRVS - Is it possible to get current Row # without another variable in the Variable Set?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:12 AM
In a Multirow Variable Set, I want to hide a checkbox when someone tries to edit the first row only. My checkbox is used to copy the contents of the previous row to the current one (while in the MRVS pop-up form), so it's not ideal that it shows on a row it can't be used. I do have a Client Script that hides it when the first entry is made, but after that...
I want to avoid adding a 'Row Number' variable just for this, mainly because I have no way to hide it.
Is there no mechanism to 'get current row #' OOB?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:15 AM
Hi @Shane J ,
Can you try to count the rows when a change is made in multirow variable set , and see if the count returns 1 then do your operation and if count is greater than 1 then stop the operation upon onsubmit or inform the user accordingly.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:18 AM
Getting the full count only works for the first entry, everything after that the logic doesn't work because you don't know what row you're currently on.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 06:23 AM
you won't know this as OOB there is nothing to determine this.
may be you can detect add/remove of row and check this
MRVS detect when a row is removed or deleted
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader