IntegrationHub ETL - 1-M Relations to JSON Objects in Array [WorkAround]

BenzChua31
Tera Contributor

WORKAROUND: We have decided to use JSON Import instead of CSV Import. We had a goal to simplify the process for our clients, but CSV Import seems to be complicating it even more than JSON Import. Not worth the time and effort to implement data from CSV Imports. 

Context: I have an array of JSON objects under a field called "relationships". Each JSON object represents the CI/AWS Resource that the current CI record has relations with. 

Here is an example:

BenzChua31_0-1689049767402.png


What I want to achieve:

Create CIs for each JSON objects in the array, then associate it with its respective CI. This is a CSV Import from AWS Config Advanced Query. 

Reason for using IE-ETL:

This was a client request to implement a temporary IE-ETL as an alternative discovery. If this is indeed a limitation, then it's time for a re-evaluation. 

What I have tried:

  • I tried using Multi-Script Operation w/ Multiple Output, but I don't know how to make it work.

    Issue with this approach... I need to explicitly/manually create an output column and then map the data to the column. I have tried creating a column directly from script, but it doesn't seem to work. Using this approach practically requires you to assume a max number of relationships this CI can have which is not ideal. 

    I believe this is what ServiceNow wants me to do in the meantime? Since you can add multiple lookups for Network Adapters in the attribute/field mapping view. 

  • I thought of creating the CI directly from the script.

    But... how am I supposed to establish the relationship? One is in a staging environment, the other in a production environment. It is also not wise to do this way, as there won't be rollback options. 

 

Utah, latest version. PDI, I can grant access for experimenting if needed. 

1 ACCEPTED SOLUTION
8 REPLIES 8

Hi Pratiksha5,

Thanks for the link but I've tried importing the JSON. It does offer a nested tree structure for visibility purposes.

The problem I have is: How do I map an array of JSON objects to a particular record. 

Say this VM instance record has a field "relationship" containing an array of NICs. I want to establish a relationship between the NICs in this array and the VM instance that holds this array. How can I do this? 

I thought about creating a Network Adapter (NIC) class in the Class Mapping section but how can I extract the information from the array and populate the class. The array would need to be treated like a list of NICs records.

From where you are getting the data? 

 

AWS Config Advanced Query

All good. We have decided to ditch CSV Import and went with JSON Import instead.

It doesn't seem CSV supports nested data source at the moment.