How to map dot-walked field in transform map?

sheikhassan
Tera Expert

I have pulled the Assigned_to.Mobile phone field to the cmdb_ci table.

While mapping a data to the cmdb_ci table, couldn't find the Assigned_to.Mobile phone field in the target. As, i have to map a phone number from sample data to cmdb_ci.

Moreover, how to map the dot-walked fields in transform map?

Can anyone help on achieving this.

Thanks in advance.

1 ACCEPTED SOLUTION

sheikhassan
Tera Expert

Thank you Pradeep, Ashutosh and Abhinay for your timely responses.



Abhinay, i just modified the script and made it work



Here is the script:


var gr= new GlideRecord("sys_user");


gr.addQuery('name',source.u_assigned);


gr.query();


while(gr.next())


  {


gr.mobile_phone=source.u_phone;


gr.update();


  }


View solution in original post

8 REPLIES 8

Pradeep Sharma
ServiceNow Employee
ServiceNow Employee

Hi Sheik,



You mean you want to update mobile number data in referenced table. If yes then you need to handle this via script.


http://wiki.servicenow.com/?title=Transform_Map_Scripts


Ashutosh Munot1
Kilo Patron
Kilo Patron

Is the field type same, and yes script is required as pradeep said.


Abhinay Erra
Giga Sage

You cannot directly map this.You will have to query on user table and fill in the phone number there.



var gr= new GlideRecord("sys_user");


gr.get(source.<filed name of assigned_to>);


gr.mobile_phone=source.<phone number field name>;


gr.update();


Thanks for your response.



Tried this but no luck.



Please find the sample..This i have to map to assigned to field and assigned_to.mobile phone in cmdb_ci table.


Untitled.jpg