How to update records in target table using transform map

Priya75
Tera Contributor

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";

}

 

 

17 REPLIES 17

it is showing insert, can we Use source script in the field map of NAME field?

 

@Priya75 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

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.

 

@Priya75 

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

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

Okay, now i am getting false and action as update. but still isn't updating active one.