- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2023 09:10 PM
I would like to set the number of rows in a multi-row variable set to a variable in a catalog item, how should I implement this?
The requirement is that the value of the corresponding variable ("count result" in the image) is updated when it is added to the multi-line variable set.
Solved! Go to Solution.
- 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 || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- 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