Records should not get insert, it should get update only if the Coalesce

Community Alums
Not applicable

Hi Experts!

I have a requirement, there is a string field on the target table called "PO number"  , I have made that field as Coalesce, while doing the bulk upload if the record found it is updating that record, if record not found it is creating a new record with blank detail, we don't want to create or insert a new record, we just want to update the records.

I have tried with below script in on before script it is not working it is still allowing to insert new record.
if(action =="insert")
ignore =true;

 

and I have tried with other script as well where I'm querying the target table and searching for the  record if not found then ignoring the insertion, that is also not working, kindly suggest me a solution for this.

CHAITHANYA13_0-1687962733739.png

Thanks in advance,
Chaithanya

1 ACCEPTED SOLUTION

Harshal Aditya
Mega Sage
Mega Sage

Hi @Community Alums ,

 

Hope you are doing good.

 

Instead of using "ignore = true" in transform map script could you please use the same in run script in transform map record

HarshalAditya_0-1687966660171.png

 

Please mark this response as correct or helpful if it assisted you with your question.

Regards,
Harshal

View solution in original post

10 REPLIES 10

Ankur Bawiskar
Tera Patron
Tera Patron

@Community Alums 

did you check what value the action variable holds?

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

Community Alums
Not applicable

Hi @Ankur Bawiskar 
Yes, I have checked the type of action holds "insert" only

Thanks,
Chaithanya

@Community Alums 

then it should work fine

share onBefore transform script screenshot

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

Community Alums
Not applicable

Hi @Ankur Bawiskar 
There was one more onafter transform script, that was conflicting with Onbefore script, replaced onafter transform script with Business rule, now onbefore transform script is working fine to ignore the insert action.


Thanks,
Chaithanya

@Community Alums 

Glad to know.

Please close the thread by marking appropriate response as correct.

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