Dynamic filters not working in UI Policy

sergioext
Kilo Explorer

Hello,

I have a UI Policy with the following Dynamic filter:

find_real_file.png

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:

find_real_file.png

Any help please?

Thank you

1 ACCEPTED SOLUTION

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      


View solution in original post

13 REPLIES 13

Chuck Tomasi
Tera Patron

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...


Thank you Chuck, when you find something out I'll mark it as Correct then!


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      


Hi Chuck,



Thank you very much for the info.



I'll just script it then.



Regards,


Sérgio