- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2022 09:51 PM
Hello All,
Would like to have guidance/help from expert on the below requirement. Transform map process records row-wise but customer expectation is different as mentioned below, how can we achieve this?
We are using a transform map to either create or update records via a single transform map (The primary key is the "description" column) from an excel file. The customer expectation is now if the source excel file has duplicate records (means the same description in multiple rows in a file), then the system should identify and ignore taking further actions for such duplicate records and give some message/error to the user that this description has duplicate records in a file.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2022 10:12 PM
@MPP22 Tried and tested solution.
Create a onBefore transform script and add the below code to it.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-18-2022 10:12 PM
@MPP22 Tried and tested solution.
Create a onBefore transform script and add the below code to it.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 12:47 AM
Thanks, @jaheerhattiwale for the immediate solution. It's working but noticed the below behavior specially first one as the transform script which I built is common for inserting and updating records.
1. If the record does not exist, the first time it will insert, the second time it will update and third time onwards it will start throwing duplicate record errors. - Can we do something here to stop updating same record as same record was already inserted first time ?
2. If record does exist, first time it will update, second time onwards it will start throwing duplicate record errors. - Working as per expectation.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2022 01:18 AM
@MPP22 Actually the code should insert only once and second time onwards it should show the log? Because there is no code written for updating the record.
Added ignore=true to avoid updating also.
Please mark as correct answer if this solves your issue.
ServiceNow Community Rising Star, Class of 2023