Transform script to check the source record exist in target table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 07:43 AM
Hi All,
I had a requirement to check the source field(caller)incident table is exist in the target field(approver)user table (sys_user) if the record is exist then map that field,else keep the target field as empty
How to achieve this using tranform script in field mapping
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 08:04 AM
Hi @Sangeetha8
You can make the field mapping coalesce as true, it will work same way how you have to do.
For More Details Refer this link - https://docs.servicenow.com/bundle/vancouver-integrate-applications/page/administer/import-sets/conc...
Please appreciate the efforts of community contributors by marking the appropriate response as the correct answer and helpful. This may help other community users to follow the correct solution in the future.
********************************************************************************************************
Cheers,
Prashant Kumar
ServiceNow Technical Architect
Community Profile LinkedIn YouTube Medium TopMate
********************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-29-2024 08:06 AM
Hi @Sangeetha8
You can use coalsec but I am interested to know what is exact use case.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 12:29 AM
My issue is that once integration is happened there is a empty record gets created in the sys_user table if there is no matching found in field mapping.
How to rectify this issue
Can I write a source script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-30-2024 01:40 AM
Hi @Sangeetha8,
This is very easily skipped by the use of an 'onBefore' 'Transform Script'.
See the below screenshot to help visualize and use the following code within the Source Script. (Obviously, check against the appropriate field for your needs. Here I am using the email address)
To help others (or for me to help you more directly), please mark this response correct by clicking on Accept as Solution and/or Helpful.
Thanks, Robbie