Hello,
I'm having issues with a correct schema for a Parse JSON. I'm getting the JSON from an HTTP response and that part is fine. An example response is below. I've used this and the actual response to "generate schema" and it doesn't seem to work correctly. The amount of "jobcodes" will be 1-50. I need to build an array consisting of the number for the jobcode either using the actual jobcode or the id field. I've tried.... After the Parse JSON, I invoke an apply to each, use dynamic value "jobcodes" from Parse JSON. Attempt to append to array variable but if I use "jobcodes" it fails because this is an object. I can't seem to use "id" because its treating each "id" separately as @{body('Parse_JSON')?['results']?['jobcodes']?['26508071']?['id']} for example. I wont know the number so I cant step through that way. I feel like I'm just doing something wrong and not seeing it as I have done similar processes before in flow/automate.
Drilled to one line, how can I parse the below JSON and come up with 17288279,17288283 in an array with the condition that it might be two values or 50.
{
"results": {
"jobcodes": {
"17288279": {
"id": 17288279,
"parent_id": 0,
"assigned_to_all": false,
"billable": false,
"active": true,
"type": "regular",
"has_children": false,
"billable_rate": 0,
"short_code": "asm",
"name": "Assembly Line",
"last_modified": "2018-07-12T21:13:14+00:00",
"created": "2018-05-28T20:18:17+00:00",
"filtered_customfielditems": "",
"required_customfields": [],
"locations": [],
"connect_with_quickbooks": true
},
"17288283": {
"id": 17288283,
"parent_id": 0,
"assigned_to_all": false,
"billable": false,
"active": true,
"type": "regular",
"has_children": false,
"billable_rate": 0,
"short_code": "dev",
"name": "Development Team",
"last_modified": "2018-05-28T20:19:33+00:00",
"created": "2018-05-28T20:19:33+00:00",
"filtered_customfielditems": "",
"required_customfields": [],
"locations": [],
"connect_with_quickbooks": false
}
}
},
"more": false
}
Solved! Go to Solution.
Hi @DHepler
Please follow the below steps. First step pass your json values under the Parse JSON step.
Above Compose 2 expression is as follows:
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThere's an XML hack for this out there, from John Liu that will likely sort you out on this. I'm not saying this to answer the question, just ... if you don't get an answer for a while, you could look it up, it's really good.
I have used it in a few answers on this site (if you can find them, then awesome!) and personally a few times to sort data like this.
But you'll need to be clever, here.
Hi @DHepler
Please follow the below steps. First step pass your json values under the Parse JSON step.
Above Compose 2 expression is as follows:
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blog@abm,
This worked brilliantly! Thank you so much. Seems like a lot of hoops for what seems to be a simply thing but it works and that is all that matters.
Thank you so much.
Dave
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
27 | |
23 | |
17 | |
10 |
User | Count |
---|---|
66 | |
58 | |
29 | |
27 | |
25 |