How do I Make the VIP Value Active for Users with a Specific Item Number?

Xavier_Wharton
Giga Guru

I want to automatically mark VIP as true for specific users in my organization based on their job item number (this is related to their job title). 

 

All users are provisioned through Azure, and the Item Number field is auto-populated based on a field in Active Directory. 

Please see the video explainer below for more details. 
https://youtu.be/ri3zNKsJV2k


 

2 REPLIES 2

Sandeep Rajput
Tera Patron
Tera Patron

@Xavier_Wharton You need to create a business rule on sys_user table as follows.

Screenshot 2023-10-29 at 12.04.52 AM.pngScreenshot 2023-10-29 at 12.07.10 AM.png

Once this business rule is configured, VIP flag would be automatically set for those users having item number 9722.

 

Hope this helps.

Raghu Ram Y
Kilo Sage

@Xavier_Wharton 

You can proceed with sandeep's suggestion for the new records, and for the existing records you can use the below example code(replace with ur tablenames and field names)

var setVIPValue = new GlideRecord('sys_user');
setVIPValue.addEncodedQuery('ItemNumberFieldNameLIKE9799^vip=false');
setVIPValue.query();
while(setVIPValue.next())
{
setVIPValue.vip = true;
setVIPValue.setWorkflow(false);
setVIPValue.autoSysFields(false);
setVIPValue.update();
}

Note: Please make sure to validate the field names and table names before executing the code as those names will be vary platform to platform.

 

Please mark my response as both HELPFUL and CORRECT, it it helps.

 

Regards,

Raghu.