Transform script to upload data in to relationship table

Anil9
Tera Contributor

Hi Community,

I need help with transform scripts. I have a 1,00,000 records data that need to be uploaded on to 'rel_ci' table. Now in this table i have parent field and parent location then child field and child location then type fields. totally 5 fields and i have the data for all the 5 fields.

Now suppose if my data contains like this:

Parent: ABC,  Parentlocation: ABCLocation, Type: ParentcontainChild Child: XYZ, childLocation: XYZLocation.

Here now i can have multiple ABC accounts in the parent field reference and multiple XYZ accounts in Child reference.

But for single location there will be only one account. Now i want to map the records being uploaded to those particular parent and child only. Please help.

4 REPLIES 4

Anshu_Anand_
Kilo Sage
Kilo Sage

Do you have these parent CI and CHILD ci and location already created in cmdb ?

since the parent, child, and their locations are reference fields, it will look for these fields while importing

If there are same names in reference fields, it will pick up the first matching name . if sys_id it will go for exact parent,child or location.

 

 

Regards,
Anshu

Hi Anshu,

Yes, We have the parent and child already in the system. Now that we want to have this relationships established between these 1,00,000 records by importing data on relationship table.

Ankur Bawiskar
Tera Patron
Tera Patron

Hi,

since your target table is rel_ci and parent and child are reference field it can hold only 1 value

Regards
Ankur

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

Hi @Ankur Bawiskar ,

Here from the screenshot the location under parent is dot walked field and child location is also dot walked field.
Now when i tried to create a transform map i am unable to see those dot walked fields in my target table. Can yu help me how i can get those dot walked fields in my target table below.

Thanks in advance.