Hi All,
I am trying to parse a JSON response I get but struggling to do so. Any help would be appreciated, Thanks.
Content:
Solved! Go to Solution.
Hi
If your HTTP output is an array of objects, I would add an 'Apply to each' just after 'HTTP' action block, using 'HTTP' output as its input.
THen I would move 'Parse JSON' inside the apply to each,using item() as its input.
Please also note if you are currently grabbing the JSON stuff from somewhere else, you can use 'PArse JSON' option called “Use sample payload to generate schema“ and inject one of your current example objects to build the JSON schema:
{
"id": 13598,
"name": "Sandbox Test Project",
"display_name": "1234 - Sandbox Test Project",
"project_number": "1234",
"address": "6309 Carpinteria Avenue",
"city": "Carpinteria",
"state_code": "CA",
"country_code": "US",
"zip": "93013",
"county": "Santa Barbara County",
"time_zone": "US/Pacific",
"latitude": 34.3850438,
"longitude": -119.4908492,
"stage": "None",
"phone": null,
"created_at": "2020-01-14T00:40:02Z",
"updated_at": "2020-01-14T00:41:14Z",
"active": true,
"origin_id": null,
"origin_data": null,
"origin_code": null,
"estimated_value": null,
"project_region_id": null,
"project_bid_type_id": null,
"project_owner_type_id": null,
"photo_id": 307004,
"company": {
"id": 24588,
"name": "My Procore App"
}
}
Hope this helps
Proud to be a Flownaut!
hi @thomas1992UK are you receiving this response from your HTTP? What I can see is that you have multiples json roots, please see this web page https://jsonformatter.curiousconcept.com/. What you can do is try changing your API to send just 1 valid json root.
Proud to be a Flownaut!
Hi @ChristianAbata - thanks or your reply. How do I get just one response? The error message is now saying it is an array, I have updated the schema too the below:
Hi
If your HTTP output is an array of objects, I would add an 'Apply to each' just after 'HTTP' action block, using 'HTTP' output as its input.
THen I would move 'Parse JSON' inside the apply to each,using item() as its input.
Please also note if you are currently grabbing the JSON stuff from somewhere else, you can use 'PArse JSON' option called “Use sample payload to generate schema“ and inject one of your current example objects to build the JSON schema:
{
"id": 13598,
"name": "Sandbox Test Project",
"display_name": "1234 - Sandbox Test Project",
"project_number": "1234",
"address": "6309 Carpinteria Avenue",
"city": "Carpinteria",
"state_code": "CA",
"country_code": "US",
"zip": "93013",
"county": "Santa Barbara County",
"time_zone": "US/Pacific",
"latitude": 34.3850438,
"longitude": -119.4908492,
"stage": "None",
"phone": null,
"created_at": "2020-01-14T00:40:02Z",
"updated_at": "2020-01-14T00:41:14Z",
"active": true,
"origin_id": null,
"origin_data": null,
"origin_code": null,
"estimated_value": null,
"project_region_id": null,
"project_bid_type_id": null,
"project_owner_type_id": null,
"photo_id": 307004,
"company": {
"id": 24588,
"name": "My Procore App"
}
}
Hope this helps
Proud to be a Flownaut!
User | Count |
---|---|
90 | |
41 | |
22 | |
20 | |
16 |
User | Count |
---|---|
133 | |
53 | |
47 | |
36 | |
25 |