- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 07:34 AM
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.
Thanks in advance,
Chaithanya
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-28-2023 08:38 AM
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
Please mark this response as correct or helpful if it assisted you with your question.
Regards,
Harshal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 12:20 AM
@Community Alums
did you check what value the action variable holds?
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-30-2023 03:36 AM
Hi @Ankur Bawiskar
Yes, I have checked the type of action holds "insert" only
Thanks,
Chaithanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-02-2023 11:14 PM
@Community Alums
then it should work fine
share onBefore transform script screenshot
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 01:19 AM
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2023 01:59 AM
@Community Alums
Glad to know.
Please close the thread by marking appropriate response as correct.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader