- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 03:29 PM
hey there and thanks in advance.
I have a record producer that I'm creating. I have a "Name" field that autopopulates with the users ID when they enter for the form. To do this I've created a variable on the record producer called "Name" and set the default value of the variable to javascript: gs.getUserID();
this is correctly populating the field.
I then need to have a UI Policy for the record producer to make 1 of 2 different questions (i.e. 1 of 2 different variables, "Question YES" and "Question NO") appear based upon the condition that one of the fields on the user record (that is now populating the Name field) is set to either YES or NO. The field on the user record that I need to govern the UI Policy is AD Domain. If the user has the value "YES" then I need one of the questions to appear, if the user has the AD Domain value of "NO" then I need the other question to appear.
I have created 2 Catalog UI Policies for the record producer called "Show Question YES" and Show Question NO" and set the catalog conditions on each to the related field "user_name.AD Domain" is YES. I then set the UI Policy Action to have the question_YES field Visible=true or question_NO field Visible=true depending on which way I want it to go.
However, this is not working. Whether the user has AD Domain set for YES or NO, it makes both the questions appear.
Is there something preventing my condition from making the UI Policy work properly?
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 08:37 PM
I played around with this a bit and I don't think you can actually use the UI Policy condition on a dot-walked field on a record producer. You can still use the AD Domain variable created on the Record Producer. I would probably populated it with an onLoad client script, most likely making a GlideAjax call to do a server lookup to get the User's AD Domain field.
You could also just use a client script to do a GlideAjax call onChange of the User field and show or hide your field based on the results of that.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 03:51 PM
Hello Patrick,
You can manage this with one UI policy. Make sure reverse to false checkbox is set to true.
If you are still blocked please share the screenshot so that I can try to help you.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 03:52 PM
When you use a UI Policy that is based on a dot-walked field (user_name.AD_Domain), you actually have to have that dot-walked field on the form for the UI policy to apply. You can have a UI policy that always hides the AD Domain field, but in order for the UI policy to work, it does need to be on the form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 04:07 PM
thanks Pradeep!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-16-2017 04:13 PM
Hello David,
so do I have to have the hidden AD Domain field auto-populate as well? Do I do that with a default value script like I used for the user ID? Or do I have to use a catalog client script and script include? (I already have created these and they work, just wondering )
And does the hidden field need to be named something specific to match the (user_name.AD_Domain) dot-walked field?