- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 09:12 PM
So are you saying if count is 3 it means only 3 rows can be added by user?
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 09:18 PM
No, for example, if 4 rows are added to a multi-row variable set, I want the "count result" variable in the image to be automatically populated with "4".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 09:26 PM
for this you need to detect if user clicked add/remove, based on that populate the other variable
check this link and it will help you to detect and then modify it to populate the count variable
MRVS detect when a row is removed or deleted
OR
Why not set that variable after submitting RITM? it would be much simpler then, anyhow you are keeping that variable as readonly
If using workflow then use workflow run script and set it like this
var parsedData = JSON.parse(current.variables.mrvsVariableSetName);
current.variables.count = parsedData.length;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 09:18 PM
You want to implement this on load?
And from where you will be fetching the data? Do you have any table which is storing the data which you want to populate in the multi row variable set?
Thanks
Aniket
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 09:32 PM
I would like to update the "count result" value each time a row is added to the multi row variable set, I believe this will be implemented in an onSubmit catalog client script within the multi-line variable set.
I tried to create a script based on the following article but it did not work.
https://www.servicenow.com/community/developer-forum/get-mrvs-row-count-onsubmit/m-p/1545351