UI Policy on "Also Request For"

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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:
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 weeks ago
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:
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.