- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 05:28 AM
Hi Community,
Need help here.
we have in our table 'cmdb_ci_wap_network' brought the field on the form by dot walk i.e "vendor.website"
How do I map the value from the source (u_website) to update in cmdb_ci_wap_network table to the above field vendor.website
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 06:00 AM
you cannot have dot walked field in field map.
In your existing transform map which is on Target table "cmdb_ci_wap_network" create an onAfter transform script & you can handle this
something like this in onAfter transform script.
(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
// Add your code here
var sourceValue = source.u_website;
if (target.vendor) {
var vendorRec = target.vendor.getRefRecord(); // give the correct field name for vendor
vendorRec.website = sourceValue; // give the correct website field
vendorRec.update();
}
})(source, map, log, target);
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 08:31 AM
yes company is a field in the form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-23-2025 06:56 PM
Correct.
So either company should be populated via transform map if it's an insert happening
OR
if update is happening on target record then company should be present or created fresh
If both the above cases the transform script I shared will work fine as it will find the company in onAfter transform script and update the website field on Company
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 06:44 AM
Thank you for marking my response as helpful.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 06:48 AM
Thanks for responding. Tried below but if you can see nothing has been updated in this table
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2025 06:50 AM
did company/vendor field get populated? if yes then onAfter will work fine.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader