How to get sysid of inserted record from transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:26 PM
I have a single staging table for 2 different tables and 2 transform maps. I need a way to get sysid of the record inserted through transform map for the first table and use it for second table. Is there a way I can achieve it?
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:31 PM
Hello Raviteja K
Write a query within the script field to retrieve the relevant record from the staging table and fetch the sys_id. Your script may look similar to this:
var grStaging = new GlideRecord('your_staging_table_name');
grStaging.addQuery('some_identifying_field', source.some_identifying_field);
// Use a field to match records
grStaging.query();
if (grStaging.next()) {
target.u_reference_to_first_record = grStaging.source_table_sys_id;
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:40 PM
Hi Umesh
I need to retrieve sysid of the record that got inserted by transform map. For example sysid of the user record that got inserted from excel sheet data.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:40 PM
Hi @Raviteja K
What is the exact use case, probably that provide more insight towards fixing your issue.
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-27-2024 09:54 PM
Hi Aman
We receive invoice and invoice lines data in the form of excel. First we need to insert invoice record and later invoice lines record and update invoice record in that invoice lines record.