Hi,
I'm currently tyring to use the graph that list all users from: https://support.infogix.com/hc/en-us/articles/360042748714-How-to-List-Users-in-Analyze
However, i get an error when i try to parse the Json for the users.
The error says:
Field "lastName" does not exist on output (0) "out1". Error in "ProcessRecords" at line "10".
I've tried to add it as a variable in the configureFields part of the Transformer node but then i simply get another error due to a Unknown Type (using str).
The Json looks as followed :
{
"users" : [ {
"user" : {
"id" : "xxxxx-yyyy-zzzz-aaaa-bbbb",
"tenant" : "defaultTenant",
"name" : "John",
"imported" : true,
"active" : true,
"state" : "ACTIVE",
"principalImportDetails" : {
"uniqueImportReference" : "xxxx,yyyy,zzzz",
"importSource" : "xxxx,yyyy,zzz",
"removedFromSource" : false
},
"attributes" : null,
"firstName" : null,
"lastName" : null,
"emailAddress" : null
}
}
]
}
The code that is used in the Transformer node looks like this (Default from the downloaded graph):
ConfigureFields
out1 += in1
out1.id=str
out1.name=str
out1.principalImportDetails=str
out1.active=str
out1.state=str
out1.imported=str
out1.tenant=str
out1 -= in1.BaseURL
out1 -= in1.LTK
out1 -= in1.URL
out1 -= in1.response
out1 -= in1.StatusCode
out1 -= in1.StatusMessage
import json
ProcessRecords
response=json.loads(fields.response)
if in1.StatusCode<>200:
node.logger.error("Failed:"+in1.StatusMessage)
raise node.fail()
out1+=in1
users=response['users']
for j in users:
user=j['user']
out1 += user
node.write(0,out1)
When i manually extract all the fields it works but i assume this should work automatically (assuming the graph on the site was correct).
The bottom 4 fields about the FirstName, Lastname, Attributes and emailAddress never work.
When i use a JSON data node. It extracts all the fields properly except the 4 null value fields at the bottom.
Am i missing something here? How do i get those last 4 fields and why do i get the error in the first place when i run the graph as it was without chaning the transformer node?
Thanks,
Jurgen