Good morning,
After submitting an HTTP API POST request, I am using a ParseJSON on the response.
I have attached an example of the ParseJSON output..
#1 - I have been running into issues trying to process this output as I am told it's an Object rather than an Array.
#2 - The Output data contains the necessary information (eg: "user_id", "client_id", etc), but each group is nested under another level which is named the same as the user_id. Therefor for each item is nested under a differently named level.
I have been unable to extract this data into anything useable.
A compose step of:
body('Parse_JSON_2')?['results']?['payroll_report']?['XXX691']
returns the data for that specific user_id as per attachment, but that is as close as I have managed to get. And that is not using the 'user_id' field, but the next level up.
I will not know the user_ids in advance as they will change.
I am looking to get an array output of the displayed fields.
Any help would be greatly appreciated!
The schema for the ParseJSON:
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"results": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"payroll_report": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"Handler": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"user_id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"client_id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"start_date": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"end_date": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_re_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_pto_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_work_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_paid_break_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_unpaid_break_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"pto_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {}
}
}
},
"overtime_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"2": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"1.5": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"timesheet_count": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"results": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"payroll_report": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"Handler": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"user_id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"client_id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"start_date": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"end_date": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_re_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_pto_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_work_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_paid_break_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"total_unpaid_break_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"pto_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {}
}
}
},
"overtime_seconds": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"2": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"1.5": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"timesheet_count": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}