How to update records in target table using transform map
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-07-2023 09:19 PM - edited 06-07-2023 09:23 PM
Hi All,
I want to update records , I am using coalesce on name field but i want to update only active records in target table.
how can i achieve that. I am using before transform script ,but it is not updating the records where active is true and name field has a duplicate(one as active=false).
if(action == "insert"){
ignore = true;
}
if(action=="update" && target.active == true){
action="update";
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 12:12 AM
it is showing insert, can we Use source script in the field map of NAME field?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 12:16 AM
since it's showing insert then the name coming from import set is not an exact match
If it would have been an exact match and since you have marked it as Coalesce it should find and set action as update
please check the name is exact, no leading or trailing space in the import set field
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 12:26 AM - edited 06-08-2023 12:28 AM
i don't think so there is something like that, i am also getting warning as "More than one target records exists for target table cmdb_ci_business_app with query name=Salesforce "
earlier also i have used the same to bulk uplaod only few records didn't get updated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 12:29 AM
if import set field is having exact same name as in target table then it should consider it as Update and not insert.
Definitely some issue with the import set data. please debug it
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2023 01:04 AM
Okay, now i am getting false and action as update. but still isn't updating active one.