UI Policy condition [is (dynamic)] [One of My Groups] isn't working

xiaix
Tera Guru

So on a record we have two fields, Assignment Group and Assigned To.

I'm writing a UI Policy where Assigned To can only be filled in if you're a member of the chosen Assignment Group.

Here is that Policy logic:

find_real_file.png

find_real_file.png

 

This basically says, If the Assignment Group is one of my groups, then Assigned To field is NOT read-only.  Otherwise, it is.

So, here is the policy in action:

find_real_file.png

 

I am a member of the ServiceNow Admin group.  So why is Assigned To ready-only????

I turned on UI Policy debugging and here's what it says when I reload the form:

find_real_file.png

What?
assignment_group's value of "11a3bc9adb8b360083c9d411ce961934 [ServiceNow Admin] " with the condition( DYNAMIC d6435e965f510100a9ad2572f2b47744) evaluates to FALSE

Why is it returning false??

If I run this in a background script:

find_real_file.png

This is my result:

find_real_file.png

11a3bc9adb8b360083c9d411ce961934 is there, so it should return TRUE , meaning that it sees me in that group!

 

Any idea why the UI Policy's filter thinks I'm not in that group?

1 ACCEPTED SOLUTION

Kush Sharma
Tera Guru

Dynamic filters doesn't work in UI Policy.

This post can give you better idea.

https://community.servicenow.com/community?id=community_question&sys_id=c542c7addb98dbc01dcaf3231f96...

 

Please mark helpful/correct if my answer helped you in any way.

Thanks

View solution in original post

6 REPLIES 6

Kush Sharma
Tera Guru

Dynamic filters doesn't work in UI Policy.

This post can give you better idea.

https://community.servicenow.com/community?id=community_question&sys_id=c542c7addb98dbc01dcaf3231f96...

 

Please mark helpful/correct if my answer helped you in any way.

Thanks

Yeah... well ya wanna know the real sad part?  I posted a reply in your linked thread not too long ago!  Doh!  ::hangs-head-in-shame::

Thanks kushal!

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

Dynamic filters not supported in UI policy condition field since UI policy condition field evaluates at client side and not server side and that method is server side

use onchange client script for this

Mark Correct if this solves your issue and also mark Helpful if you find my response worthy based on the impact.
Thanks
Ankur

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

Harsh Vardhan
Giga Patron

Instead of using is (dynamic) you can use the below condition in your ui Policy. 

 

find_real_file.png

 

This will work. give a try .