Multi-row Variable Set - check for duplicates (or only accept unique values)

JLeong
Mega Sage

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. 

find_real_file.png

 

I am doing it on a Catalog Client script. Please assist.

Thank you in advance.

Regards,

Jocelyn

 

1 ACCEPTED SOLUTION

shouvik
ServiceNow Employee
ServiceNow Employee

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.

View solution in original post

18 REPLIES 18

Jace Benson
Mega Sage

You can get the values and then just do an array diff function on the array;

https://stackoverflow.com/questions/1960473/get-all-unique-values-in-a-javascript-array-remove-dupli...

Hi Jacebenson,

Thanks for your response. I will try this and let you know. I am also having problem getting the right value. 

I appreciate your time.

 

Regards,

Jocelyn

 

Shayon
Kilo Contributor

Hi JLeong

I am having similar problem, not able to get the values in the variable to validate it with the value to be entered, please let me know if you have found a solution.

Hi Shayon,

Sorry we ended up not using the MRVS. Maybe we will try again in the near future.