Create Field Maps of Transform Maps thru scripting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 07:15 PM
Hello guys,
I am currently assigned in researching this topic. Of course, I have been researching this past few hours but to no avail, I could not find the answer(s) so I'm trying my luck here.
My task is to find ways how to create new field maps record in Transform Map through scripting?
Is this possible and if yes, how? I would really appreciate it if you can help me. Please.
REASON:
We create applications on a project and new applications have some fields that are the same as the existing applications, and it would save time if we can script this. I know there is an automapping feature but other fields will be affected if we use that and some fields use script instead of field to field mapping.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 07:49 PM
Hi, I am sure it is possible, but the cost\and time overhead of setting source\target tables, mapping the fields in your code, validating the script in Dev every time you update/alter it and then deploying the updated code to production, might result in an increase in an admin overhead rather than a reduction.
Otherwise, the field mapping table 'sys_transform_entry' is just like any other ServiceNow table and you would simply need to use GlideRecord to iterate through your data and create new field map records as required.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 09:25 PM
Thank you very much. Yup. Currently, I'm searching for the code.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-22-2022 08:33 PM
Hi,
it should be possible from scripting but I would recommend avoiding it
Using field maps give you control whether you want to direct map or use field map script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-23-2022 11:51 PM
Thank you for the reply. The reason why we need to code it is because new services that are being added have some fields that are the same from the existing services(applications).
The downside of using Auto Map Matching Fields is it maps everything, and the mapping assist takes time. If we could just code the part where it is only necessary to create a map then it would fast track our speed.