Why Import set is only updating not inserting new records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 02:09 AM
error message
script to fetch RAM sys_id
excel sheet
if entity and current ram combination found simply update he record
if not insert new one
RAM is the field on target table which should get updates with expected RAM column from excel sheet

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-06-2024 03:24 AM
Hi @Prathamesh Cha1 ,
Can you comment ignore =true; and try
When your query wouldn't find existing record it goes to the else part and skipping everything.
var up = new GlideRecord('sn_risk_advanced_risk_assessment_methodology');
up.addEncodedQuery("name=" + source.u_expected_ram + "^state=2");
up.query();
if (up.next()) {
target.risk_assessment_methodology = up.sys_id;
} else {
//ignore = true;
}
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
08-06-2024 04:28 AM
Hi @Hemanth M1 ,
Thanks for reply And I tried with solution you provided but still it is skipping the records, as records do exits with that encoded query.