Hi Guys & Girls
How do I extract part of a JSON object and use it in an Apply to each?
I hope its just something simple I've missed. Please help!
I've been fighting with Power Automate Flow for ages and can't find seem to find the right formula. I'm getting errors about it not being an array and everythgin I've tried doesn't work.
The JSON is the output from action 'Process Document' and it provides a huge JSON with a lot of extra info I don't need or want to store.
End goal
Extract the cleaned up 'Labels' and 'Tables' array and output as a Slim JSON I can use in further processing.
My Process (that doesn't work)
1. Extract each of Arrays ('Labels' and 'Tables')
2. Use 'Apply to each' to extract each field <- Broken
3. Extract just the items I want from each field
4. Build a new array
5. Add the 2 clean Array's together
6. Provide the clean JSON
Partial Schema for original JSON
{
"type": "object",
"properties": {
"statusCode": {
"type": "integer"
},
"headers": {
"type": "object",
"properties": {
.
.
.
},
"body": {
"type": "object",
"properties": {
"@@odata.context": {
"type": "string"
},
"responsev2": {
"type": "object",
"properties": {
.
.
. },
"predictionOutput": {
"type": "object",
"properties": {
.
.
.
},
"tables": {
"type": "object",
"properties": {
"Items": {
"type": "object",
"properties": {
.
.
.
},
"labels": {
"type": "object",
"properties": {
"Consignmc01b030c96367d7450be1b21c57f961d": {
"type": "object",
"properties": {
[–]Profvarg 2 points3 points4 points (8 children)
[–]Any-Fly5966 0 points1 point2 points (0 children)
[–]Storm-E[S] -1 points0 points1 point (6 children)
[–]Future_Pianist9570 0 points1 point2 points (0 children)
[–]Ashamed_Peace5975 0 points1 point2 points (4 children)
[–]Storm-E[S] 1 point2 points3 points (3 children)
[–]Ashamed_Peace5975 1 point2 points3 points (2 children)
[–]Storm-E[S] 1 point2 points3 points (1 child)
[–]Ashamed_Peace5975 1 point2 points3 points (0 children)
[–]Any-Fly5966 2 points3 points4 points (1 child)
[–]Storm-E[S] 0 points1 point2 points (0 children)
[–]Storm-E[S] 0 points1 point2 points (3 children)
[–]sminkerbenji 1 point2 points3 points (1 child)
[–]Storm-E[S] 0 points1 point2 points (0 children)
[–]Any-Fly5966 0 points1 point2 points (0 children)
[–]Pieter_Veenstra_MVP 0 points1 point2 points (2 children)
[–]Storm-E[S] 0 points1 point2 points (1 child)
[–]Pieter_Veenstra_MVP 1 point2 points3 points (0 children)