Validation on two reference field

Community Alums
Not applicable

Hi Team ,

Hi Team,

 

I have one requirement for my project: there is a record producer with two fields, 'Select Primary Approver' and 'Select Secondary Approver.' Both fields are reference fields that refer to the sys_user table. The requirement is that if I select a user, for example, Abel Tuter, in the 'Select Primary Approver' field, I do not want that user to be available in the 'Select Secondary Approver' field."

 

image (1).png

6 REPLIES 6

Voona Rohila
Kilo Patron
Kilo Patron

Hi @Community Alums 

A simple Catalog UI policy would work.

Conditions - Select Primary Approver || is not empty ( Change your conditions accordingly)
In UI Policy actions - Select Select Secondary Approver field and check Hidden true, mandatory false.


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Community Alums
Not applicable

Hi @Voona Rohila   the requirement is selected user in primary approver field is not available  in secondary approver field

 

for ex -  In primary approver field   If I select "Abel tuter" then I don't want Abel Tuter in secondary approver field

Ohh Okay, You can write a advanced reference qualifier on secondary approver variable dictionary. 

 

javascript: 'sys_id!='+current.variables.variablename // replace variablename with first approver variable name.

 

 

VoonaRohila_0-1729177863231.png

 

Mark it helpful if this helps you to understand. Accept Solution if this gives you the answer your looking for!!


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP

Thank you for marking response as helpful, Is your issue fixed?


Mark it helpful if this helps you to understand. Accept solution if this give you the answer you're looking for
Kind Regards,
Rohila V
2022-25 ServiceNow Community MVP