Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

Can you post the script you have now?


This is the script, i have used.



Please correct if it is wrong.



var gr= new GlideRecord("sys_user");


gr.get(source.Assigned);


gr.mobile_phone=source.Phone;


gr.update();


This is assuming the values in the excel sheet exactly matches with name of your sys_user records



Here is your script:


var gr= new GlideRecord("sys_user");


gr.get('name',source.Assigned);


gr.mobile_phone=source.Phone;


gr.update();


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();


  }