Need help in updating user table with sso source using transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2022 05:24 AM
Hello Experts,
I new for transform map script and loading data.
I want to update 900 existing records with sso source field and from Active directory team I got excel where I got email address and name column.
In our instance many users having same userid as email id.
And as its CSM having multiple entries for single user with same email address.
For few users useid and email id is not same so when in the dev I mapped using source.email = target.userid that time new record got created for these users.
I want to write a script where it will check email id from excel is equal to userid from user table and if not then
it should check the email id from excel is equal to email from user table and class as User
if this is true then update sso source.
Please help.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-15-2022 06:22 AM
Hi,
You can update the SSO Source field based on your condition.
On your Transform map create new field map using New button as shown below.
Script: once you import the excel fields it will create the fields on the import set table. Use excel mail field backend value on source.u_email . Source method will use to get the staging table fields.
answer = (function transformEntry(source) {
if (source.u_email == target.user_name || source.u_email == target.email) {
return "Yes";
} else {
return "No";
}
})(source);
Please refer below screen and table, map will auto populate while creating but Target field should be SSO source field.
Hope it helps!!
Please Mark ✅ Correct, Thanks!!
Regards
Pavankumar
ServiceNow Community MVP 2024.
Thanks,
Pavankumar