cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MichalB_106
Frequent Visitor

Parse XML from HTTP response to JSON with Flow and save data to Entity

Hello, I can't solved problem with my flow to parse XML to JSON. I get HTTP POST response in XML format like this:

 

 

 

 

 

 

<?xml version="1.0" encoding="utf-8"?>
<databases_response>
<status>200</status>
<message>The request has been successfully processed</message>
<data>
<row id="1">
<column id="87828">BL848SS</column>
<column id="87829">PG307385</column>
<column id="87830">28.5.2018</column>
<column id="87831">13.10.2020</column>
<column id="87832">1590</column>
<column id="87833">86</column>
<column id="87834">BENZIN</column>
<column id="87835">Červená metalíza</column>
<column id="87836">5</column>
<column id="87837">1335</column>
<column id="87838">1870</column>
<column id="87839">2</column>
</row>
</data>
</databases_response>

 

 

 

 

 

 

I used xpath in my flow to get only <row></row> from response and after that transform with JSON function to JSON. Power Automate generated this schema to parse JSON:

 

 

 

 

 

{
    "type": "object",
    "properties": {
        "row": {
            "type": "object",
            "properties": {
                "@@id": {
                    "type": "string"
                },
                "column": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "@@id": {
                                "type": "string"
                            },
                            "#text": {
                                "type": "string"
                            }
                        },
                        "required": [
                            "@@id",
                            "#text"
                        ]
                    }
                }
            }
        }
    }
}

 

 

 

 

 

 

However I don't get values from <column id=xxxx> from original XML response. I think the problem is to every value hasn't got original tag, but the same use only with id=xxxxx. Is it possible to change tags <column id=> to another for example with xpath. Or create other JSON schema and parse values from <column id=xxxxx> correctly?

 

Thanks a lot.

0 REPLIES 0

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,067)