Scripted REST API creating duplicate records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 12:27 PM
Hello everyone, Hope you are doing good!
Here came a situation where we have a scripted rest api wherein a third party system creates records in the ServiceNow instance. But the third party system sends the data rapidly and the scripted rest api isn't able to work synchronously with it. In this case if the third party system sends duplicate records those gets created in SNOW.
We have an initial check in place i.e. if a matching record is found just return the sys_id of the record to the tp system, but by the time script checks it there is another record created with a different sys_id but the exact same data (duplicate).
Any suggestions on this that should be incorporated ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 10:27 PM
Hi Anirudh,
Could you explain more on how you check for duplicate records in your system? and why it is still creating a duplicate record?
Thanks
Santosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 11:28 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-05-2020 11:47 PM
Hi,
Put this data in one staging table and then do the transform of the data synchronously there. In onbefore transform script you can check the duplicates.
Thanks,
Ashutosh