Transform Map: Need coalesce behavior on computer id field when name as marked as coalesce
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hi Community,
I have a Transform Map where I have two unique fields:
- Name
- Computer ID
Currently, Name is configured as Coalesce = true in the Transform Map.
Computer ID is also an important unique field, but I cannot simply enable Coalesce on Computer ID because I have some specific scenarios that need different behavior.
I need the Transform Map to behave like this:
| Scenario | Name | Computer ID | Expected |
| New record | ABC | 123 | Create |
| Existing same Name + CID | ABC | 123 | Update |
| Same Name + different CID | ABC | 456 | Create new record |
| Update second record | ABC | 456 | Update the 456 record,not 123 record. |
| Same Name + empty CID exists | ABC | empty | Update the same-name record with empty CID |
Current problem
Suppose two records already exist:
If the incoming record is (as already this record is present in the system so expected result is to update the same record)
but because Name is the only Coalesce field, the Transform Map selects the wrong record (ABC/123) and updating the first created record
I tried using an OnBefore Transform Script to find the correct record and change target.sys_id, but this does not change the actual record selected by the Transform Map.
Requirement
I want to keep Name as Coalesce = true, but add a coalesce-like/custom target selection behavior using Computer ID so that the Transform Map can select the correct target before the normal field mappings are applied.
I want to use the standard Transform Map update/insert process, not manually update.
Is there a supported ServiceNow Transform Map configuration or script/hook that can achieve this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
47m ago
approach you can try
-> Keep Name and Computer ID field maps, but set Coalesce = false on all of them.
-> Use an onBefore transform script to:
-
Query the target table using your custom logic (Name + Computer ID).
-
Use GlideRecord update if record found, if not found then do insert and set ignore=true always as you are updating/inserting via script only
💡 If my response helped, please mark it as correct ✅ and close the thread 🔒— this helps future readers find the solution faster! 🙏
Ankur
✨ Certified Technical Architect || ✨ 10x ServiceNow MVP || ✨ ServiceNow Community Leader
