The Zurich release has arrived! Interested in new features and functionalities? Click here for more

UI Policy on "Also Request For"

daniellebell
Tera Guru

Hello Community,

 

My team has a requirement to use a Request For variable type and to enable the Also Request For option for a catalog item.  The catch is that if the Also Request For option is selected, and that variable is populated, we need to remove or hide a different variable on the form.  We have been unable to figure out to make this work.

 

Both the original "Request For" and the subsequent "Also request for" have the same variable name:  

daniellebell_0-1756310717332.png

However, writing a UI Policy, or a client script, on that field name only returns values from the "Request For" field and not for the "Also request for" field.

 

Has anyone had any luck writing a UI Policy on the "Also request for" portion of this variable type?

 

Much Appreciated.

 

7 REPLIES 7

Ankur Bawiskar
Tera Patron
Tera Patron

@daniellebell 

Why not use the custom variable of type Reference and handle the logic?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

So in this case, this catalog item will include an approval, and we want approvals explicitly responded to for each individual receiving the product. So, because Request For and also request for create RITMs for each individual, our policy is to use this field instead of using a MRVS or list collector.

acretion
Tera Expert

I suspect this is due to both variables having the same 'name ' as you mentioned in your original post.  Could you try renaming one of them and then see if that lets your ui policy work as expected?

Thank you for your response.

 

The issue appears to be that the Request For variable type includes an option for "Also Request For" - these are not two separate variables in the conventional sense, otherwise, ServiceNow would not/does not allow two variables with the same name to exist on the same form:

daniellebell_0-1756322247796.png

It's not that we have created two variables with the same name, it's that we are using an OOB variable type that can include two fields, with the same name, and we cannot figure out a way to isolate the second part, "also request for" in a script or a UI Policy.