How do I Make the VIP Value Active for Users with a Specific Item Number?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2023 08:54 AM
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2023 11:40 AM
@Xavier_Wharton You need to create a business rule on sys_user table as follows.
Once this business rule is configured, VIP flag would be automatically set for those users having item number 9722.
Hope this helps.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-28-2023 12:07 PM
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.