Transform script to upload data in to relationship table
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 02:38 AM
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.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-24-2022 02:59 AM
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.
Anshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2022 10:35 PM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-01-2022 10:41 PM
Hi,
since your target table is rel_ci and parent and child are reference field it can hold only 1 value
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-02-2022 06:44 AM
Hi
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.