IntegrationHub ETL Nested Ojbects

Ned F
Tera Contributor

Hello!

 

I've been tasked with installing and configuring the Service Graph Connector for Google Console to maintain our ChromeOS devices with our CMDB. I got the baseline installation of the plugin to work and data is flowing. The end user requested the customization of including CPU and RAM details. The RAM part was easy since the systemRamTotal was already in the top level. I simply added a transform to convert the value to MBs and updated the mapping.

 

The CPU details is proving to be a little more challenging as it has Nested Objects. It's an array that seems to have a record per CPU core. I'm primarily trying to access the model (cpuInfo[0].model) record. That data point seems to be the same per core, so I only need one of the values.

 

I've attempted to update the mapping to have the model added, but quickly discovered that doesn't work between levels.

image.png

 

I've also attempted to update the Robust Transform Engine to see if I could have the model added to the top level with no luck. I don't see the JSON record on the top level record either. I do see it in a u_data column in the staging table.

Is anyone familiar with working with nested objects in a Service Graph Connector that can help, point me at a good reference, or recommend something from ServiceNow University that can help me?

Thank you!

1 ACCEPTED SOLUTION

@Ned F When you can create a transform map, you get an option 'Output Column Name'. That will be the variable you use in further steps. (You click on 3 lines right to the variable name and click 'Create Transform').

 

You can use a 'Script Operation' Transform type to glide in another table and script as you wish. A sample script below

 

(function(batch, output) {
for (var i = 0; i < batch.length; i++) {
var input = batch[i].input;
output[i] = new sn_sg_azure_integ.SGAzureCommonsUtil().getInstallStatus(input);
}
})(batch, output); 

 

 

 

 

 

View solution in original post

6 REPLIES 6

Ned F
Tera Contributor

For anyone else that looks to use this solution. It might be worth updating the code to factor in the most recent import set. My case is fine as is, but something to consider.

@Ned F  You created cool script! Glad you got the solution and learning. 🙂