- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-01-2019 01:10 PM
Hi Guys,
Need help on Multi-row Variable Set. I only have one column (single text), but I need to make sure that user doesn't enter the same value over and over.
I am doing it on a Catalog Client script. Please assist.
Thank you in advance.
Regards,
Jocelyn
Solved! Go to Solution.
- Labels:
-
Service Catalog
- 6,501 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-06-2021 11:57 PM
This is OOB feature in Quebec. https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/product/service-catalog-management/concept/c_ServiceCatalogVariableSets.html
Variables for a variable set has an attribute called Unique which does the validation automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 05:56 AM
https://community.servicenow.com/community?id=community_question&sys_id=8557faef1b8a5050305fea89bd4bcb73
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2020 06:47 AM
Thanks Brad! I will try this too.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-27-2020 09:15 PM
It's possible to check when entering MRVS rows by creating following script in MRVS (not on the form but in the MRVS). I've tested this on Paris.
function onSubmit() {
var value = parent.g_form.getValue("<mrvs name>"); // change mrvs name
var arr = JSON.parse(value);
if (searchExisting(g_form.getValue("<column name to check>"), arr)) { // change column name
alert('There are duplicates please remove those before submitting');
return false;
}
}
function searchExisting(keyColumn, newArray) {
for (var i = 0; i < newArray.length; i++) {
if (newArray[i].<column name to check> == keyColumn) { // change column name
return true;
}
}
return false;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2020 05:22 AM
Hi Hozawa,
Yes I also had to check it on submit, could not find anyway to validate it whole adding an entry to the MVRS which would have been the ideal case, thanks for sharing the code, this would certainly help some out.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2020 05:23 AM
Thanks I will try this