Adding another "user" list to the user Criteria Record

jonathangilbert
Kilo Sage

Hello All,

Does anyone know if it is possible to have more than 1 "User" list on the user criteria record?. I am working on automation with Azure and I want to dynamically update the User Criteria record, based on the users that are in an Azure Group.

At present I can get my automation to update the OOB "User" field, but ideally I want it to update a new list called "Users in Azure group". That way the automation wont remove any other users that may have been added to the OOB "user" list manually.

jonathangilbert_0-1700220561105.png

I have found this article:-

https://docs.servicenow.com/bundle/vancouver-servicenow-platform/page/product/service-catalog-manage...

 

But following that doc, it still doesnt work. My new field is called "Users in Azure Group", with the name "u_users"

 

2 REPLIES 2

Peter Bodelier
Giga Sage

Hi @jonathangilbert 

 

The docs you reference already state: The field to add must be a reference field in the user record.

So this wouldn't work this way.

 

Why wouldn't you just add the users to a group in ServiceNow using your automation, and simply reference the group in the User Criteria?
That is how it is supposed to work anyhow.


Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.

Namrata Ghorpad
Mega Sage
Mega Sage

Hello @jonathangilbert ,

You can select Advanced checkbox to write script and in that script check if logged in user is member of "Users in Azure group" then answer will be true else answer will be false.

Write script like below.

 if (gs.getUser().isMemberOf('Users in Azure group name')) {
answer = true;
}
else {
answer = false;

}

 

Please mark my answer as correct and helpful if it helps to resolve your issue.

Regards,

Namrata