- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 09:39 AM
Hello,
I have a UI Policy with the following Dynamic filter:
The UI action is make a field mandatory but it never works. This isn't the only problem I'm having with dynamic filters. Tried to use one for a "user is (dynamic) Me" and it didn't work either.
In the Dynamic Filter Options everything fine though:
Any help please?
Thank you
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 10:38 AM
Hi Sergio,
I confirmed this is definitely a platform issue of trying to include server side features (dynamic filters) in a client side feature (UI policies.) Dynamic filters should not be allowed there.
The workaround is that you will have to create this same functionality manually via a client script. g_user should help to get the current user information, but for group info, you'll need to send a GlideAjax call. Fortunately, you should be able to leverage the same getMyGroups() logic.
Docs: Client Scripts
Docs: GlideForm
Docs: GlideAjax
Client Script Best Practices - ServiceNow Wiki

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 09:49 AM
Hi Sergio,
I have confirmed the same thing with a simple test of a user field and date field. I tried to make the date field mandatory if the user is me. I suspect it is because dynamic condition/operators are not supported in UI policies. UI policies run on the client in order to be responsive, but the dynamic filters run server side code.
I'll check with the platform team and let you know what I find...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 09:55 AM
Thank you Chuck, when you find something out I'll mark it as Correct then!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-11-2017 10:38 AM
Hi Sergio,
I confirmed this is definitely a platform issue of trying to include server side features (dynamic filters) in a client side feature (UI policies.) Dynamic filters should not be allowed there.
The workaround is that you will have to create this same functionality manually via a client script. g_user should help to get the current user information, but for group info, you'll need to send a GlideAjax call. Fortunately, you should be able to leverage the same getMyGroups() logic.
Docs: Client Scripts
Docs: GlideForm
Docs: GlideAjax
Client Script Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2017 12:54 AM
Hi Chuck,
Thank you very much for the info.
I'll just script it then.
Regards,
Sérgio