Import or fix script with an Excel file .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 10:37 PM
Hello everyone,
I have the following requirement that I am unable to implement. I have been provided with an Excel file containing one column with contract sys_ids and another column with a field for hours worked on the contracts. Therefore, each row has a sys_id and a field for hours worked. I need to update my contract table with the sys_ids of the existing contracts, updating the new field with the corresponding values (I have 240 rows). The complexity lies in the fact that I do not have a field to map, only sys_ids.
Thank you in advance for your time.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-13-2024 11:02 PM
Hi @Nabs ,
There are couples of ways to do this
1) Easy import: here is my article how to insert/update date through template https://www.servicenow.com/community/developer-articles/how-to-create-or-update-records-using-excel-...
2)You can use GlideExcelParser to read data and use GlideRecord to update the record
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 01:25 AM
Hello
thanks Hemanth M1
The problem is that I do not have a field to map for the update. I only have the sys_ids of the contracts that I need to update with the values from the "hours" field for each contract.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 01:44 AM
Hi @Nabs ,
why don’t you create a filed “Hours Worked” and map. Any issues??
Thank you,
Hemanth
Certified Technical Architect (CTA), ServiceNow MVP 2024, 2025
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-14-2024 01:47 AM
Hi @Nabs :
May I know how are you able to pull the sys_ids of the existing contract? if it a another ServiceNow instance I would suggest going with an XML import rather than an Excel import as data import are easier.
Note: Excel import impact has implications if the sys_id is already reutilized.
If you still want to go with Excel import you have to Coalesce the sys_id and map it to the target sys_id field so it updates the existing contract present on the target table.
Mark this as Helpful / Accept the Solution if this clears your issue