How to update dot walk field in Transform map

Nisha30
Kilo Sage

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"

Nisha30_0-1737638896977.png

 

 

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

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

@Nisha30 

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.

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

View solution in original post

12 REPLIES 12

Mark Manders
Mega Patron

Since the value is on a different table, you need to update it there. That means you also need to create a transform map to update the vendor table.


Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark

Ankur Bawiskar
Tera Patron
Tera Patron

@Nisha30 

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.

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

we want to update in table  'cmdb_ci_wap_network'  table .

 

 

Nisha30_0-1737642464558.png

 

Nisha30_1-1737642541647.png

 

 

@Nisha30 

that field is dot walked from vendor (Company) field.

If the Company field is present on the target then only you can set the Website field within the Company Record.

Are you also mapping Company field in your transform map?

If my response helped please mark it correct and close the thread so that it benefits future readers.

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