- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2022 10:38 AM
Hi,
I have a import set and transform map where i am importing user record based on user id and email id i need to update record when both field values are matched and i made both fields as colease to true but still it is creating a new record.
Is there a way we can acheive this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2022 10:51 AM
HI
What you can do here is write a On Before Transform Script and use the script shared below:
var getSourceUserID = source.FieldName.toString();//Replace "FieldName" with source User ID;
var getSourceemail = source.FieldName.toString();//Replace "FieldName" with source Email;
var gr = new GlideRecord('sys_user');
gr.addQuery('user_name',getSourceUserID);
gr.addQuery('email',getSourceemail);
gr.query();
if(gr.next()){
....do the update here for the fields you want as for example below:
gr.name = source.FieldName;
gr.update();
}else{
ignore=true;
}
This should work for you.
Hope this helps. Please mark the answer as correct/helpful based on impact.
Regards,
Shloke
Regards,
Shloke
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2022 04:56 AM
Any update on this?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-08-2022 12:43 AM
Hi
If you have a follow up query then do let me know, else please mark the answer as correct and close this thread for others.
Regards,
Shloke
Regards,
Shloke