- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-22-2023 05:05 AM
There is a transform map in servicenow "LDAP USERS" which creates new user or update user in user table. This transform map runs every few minutes in servicenow. There are few transform scripts attached to this transform map.
I was thinking to use onComplete() transform script to add the role to user created via transform map.
But i was also thinking to use a business rule that triggers after an insert action on sys_user table.
This is the business logic :
(function executeRule(current, previous /*null when async*/) {
// Check if the record was created or updated by the LDAP import, so when user is created via ldap transfrom map they have some value in source field starting with ldap
if (current.sourceSTARTSWITHldap) {
// Assign the desired role to the user
var roleName = 'demo_role';
current.addRole(roleName);
}
})(current, previous);
I would like to have everyone's view on which is the efficient approach performance wise as the ldap transform runs every few minutes.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 12:47 AM
Oops! Feel free to choose any of those. 😋 I just provided you with various approaches.
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-28-2023 12:47 AM
Oops! Feel free to choose any of those. 😋 I just provided you with various approaches.
Cheers,
Tai Vu