cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
WebPortal
Post Prodigy
Post Prodigy

How to map values from an array?

This is my array variable "Resultados":

 

 

 

{
    "body": {
        "name": "Resultados",
        "value": [
            {
                "fieldName": "Fornecedor",
                "fieldValue": {
                    "type": "string",
                    "valueString": "Contoso, Ltd.",
                    "text": "Contoso, Ltd.",
                    "page": 1,
                    "boundingBox": [
                        0.585,
                        0.44,
                        2.34,
                        0.44,
                        2.34,
                        0.795,
                        0.585,
                        0.795
                    ],
                    "confidence": 0.994,
                    "elements": [
                        "#/readResults/0/lines/0/words/0",
                        "#/readResults/0/lines/0/words/1"
                    ]
                }
            },
            {
                "fieldName": "Data",
                "fieldValue": {
                    "type": "date",
                    "text": "8/20/2020",
                    "page": 1,
                    "boundingBox": [
                        7.38,
                        1.08,
                        7.925,
                        1.08,
                        7.925,
                        1.175,
                        7.38,
                        1.175
                    ],
                    "confidence": 0.994,
                    "elements": [
                        "#/readResults/0/lines/2/words/1"
                    ]
                }
            }
        ]
    }
}

 

I want to extract: "Fornecedor" -> "Text".

 

How do I do that?

WebPortal_0-1638986591708.png

 

The expression above is:

variables('Resultados')['Fornecedor']['text']

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Taylor_Becktold
Resolver III
Resolver III

@WebPortal  -

 

I would recommend utilizing a combination of 'Parse JSON' and 'Filter Array' to quickly filter based on the fieldName attribute. That's going to allow you to reduce the results and then the 'text' field value should be available via the dynamic content pane. See below: 

 

Taylor_Becktold_1-1638989302840.png

 

Taylor_Becktold_2-1638989311612.png

Taylor_Becktold_3-1638989323142.png

 

Did my reply help? Please give it a thumbs up.
Did my reply answer your question? Please mark it as a solution!
If you liked my response, please consider giving it a thumbs up.

 

View solution in original post

5 REPLIES 5
Taylor_Becktold
Resolver III
Resolver III

@WebPortal  -

 

I would recommend utilizing a combination of 'Parse JSON' and 'Filter Array' to quickly filter based on the fieldName attribute. That's going to allow you to reduce the results and then the 'text' field value should be available via the dynamic content pane. See below: 

 

Taylor_Becktold_1-1638989302840.png

 

Taylor_Becktold_2-1638989311612.png

Taylor_Becktold_3-1638989323142.png

 

Did my reply help? Please give it a thumbs up.
Did my reply answer your question? Please mark it as a solution!
If you liked my response, please consider giving it a thumbs up.

 

WebPortal
Post Prodigy
Post Prodigy

Thank you @Taylor_Becktold 

I'm really puzzled with this. All I need is to extract 2 values: "Contoso Ltd" and "8/20/2020" so I can add them to a csv table.

Do I need all that??

Taylor_Becktold
Resolver III
Resolver III

@WebPortal  

 

My configuration is simply a recommendation. However, you are most likely going to need to utilize the filter action to filter the array by the JSON element of "fieldName" and get that value. In my opinion, Parse JSON makes other people with less technical expertise be able to read and understand a Flow (especially in that it provides dynamic values).

@Taylor_Becktold 

Thank you so much, my comment was more of an expression of surprise, than a claim.

I really appreciate your effort.

Taylor_Becktold
Resolver III
Resolver III

@WebPortal Not a problem! If you think it was useful, I would really appreciate it if you could mark my response as a solution. 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (1,239)