Dynamic Coalesce field in the Transform Maps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2021 07:32 AM
Hi Team,
Is there any way to set the "Coalesce" field to true based on the source value in the transform maps? Dynamically setting the "Coalesce" field to true or false based on the value received in the source field. Please provide your support as soon as possible.
Regards
Rahul
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2021 08:59 AM
Hi Sai,
Thanks for the response. Is that possible to write the logic in the transform map onBefore script without coalesce field matching value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2021 09:12 AM
You can do this by adding a field map for sys_id and making it a scripted field map. Than in the script you look up the record that matches a target record and return that record's sys_id. The system will update that record with all other data. In case you don't find a matching record, and the system should create a new record instead, you should just return a random sys_id.
Have recently answered a question on the subject: https://community.servicenow.com/community?id=community_question&sys_id=6b18a404db21741013b5fb24399619b1