Transform Map scripts - best practise?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 09:54 AM
Dear All,
I have a Transform map that is used to create contacts against accounts in our CSM system, the transform map has account numbers and contact details. Now I have an onBefore script that is used to check certain conditions:
- does the contact already exist
- is it already linked to the account number in the transform map or a different account, does a contact relationship need to be created,
- etc
Needless to say my onBefore script has grown and while it works, I was wondering if I should be doing things differently. ultimately my transform map is to bulk upload contacts that don't exist and link them to the account listed in the transform map, but if the contact does exist carry out another function and I don't think that should be done in the transform map script.
I know I can use the 'ignore' variable in the onBefore script to ignore any existing contacts but how do I then record that in a seperate log or file that I could pass to a script include to run my other checks, once the main transform is complete, I'm assuming I can do this in an onComplete script but Im not too sure how to record the information and then reference it to pass to the script include.
I hope that makes sense, if not let me know and I'll try and expalin it a bit better,
Thanks in advance,
John.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2022 10:14 AM
hello,
Please find the below article which has detailed explanation on transform map best practice.
https://www.servicenow.com/community/developer-blog/transform-map-best-practices/ba-p/2276233
Please mark my answer as correct based on impact.