Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Need help to make field mandatory in multirow variable set

sunil7
Giga Expert

Hi Everyone , I have a requirement on catalog item , we have two variable and a multirow variable set(Test1) on catalog item. Our requirement is when we select 1 in first variable (Copier paper) and 2 in second variable (Pens) then Field1 inside multirow variable set should become mandatory. Please see screenshot below

find_real_file.png

 

find_real_file.png

15 REPLIES 15

Sebastian L
Mega Sage

So I know a little "hack" for this, but I am not sure if there is any other method to it. If there is, I am not aware, and I am very keen to learn!! 


Edit: ServiceNow has added a new api for this if in Quebec or later. Solution available on developer here or docs here

 

But basically, you can create a global variable in the onload catalog client script on the catalog item: find_real_file.png

 

Then on your multi row variable set you can create an on-load client script, that retrieves this value, by using the global variable set (in this case "store_gform_value"), and then the known syntax: 

find_real_file.png

 

This should result in the below: 

find_real_file.png

 

And just to check if other values:

find_real_file.png

 

 

 Please mark my answer as Correct & Helpful, if applicable 🙂


Best regards,
Sebastian Laursen

Can you please check why it is not working for me

find_real_file.png

find_real_file.png

Are you sure the variables are correct? I just randomly named them 🙂 


Best regards,
Sebastian Laursen

Here are the variables

find_real_file.png


find_real_file.png