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

XML to JSON to PowerApps Data Source

Hi, having trouble getting this working. I'm taking XML project data from our PPM product via SOAP API, converting the XML to JSON and then attempting to flatten that JSON into what can be used as a data source for a PowerApp.

 

My XML response is giving me this back:

 

		<ns:findEntityResponse xmlns:ns="http://services" xmlns:ax21="http://objects.services/xsd">
			<ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:EntityObj">
				<ax21:entityId>168070803</ax21:entityId>
				<ax21:entityTypeId>4</ax21:entityTypeId>
				<ax21:methodValues xsi:type="ax21:ValuePair">
					<ax21:elementValue>Project & Portfolio Management (PPM) Selection & Implementation</ax21:elementValue>
					<ax21:id>436</ax21:id>
				</ax21:methodValues>
				<ax21:methodValues xsi:type="ax21:ValuePair">
					<ax21:elementValue>Complete</ax21:elementValue>
					<ax21:id>411</ax21:id>
				</ax21:methodValues>
				<ax21:methodValues xsi:type="ax21:ValuePair">
					<ax21:elementValue>Complete</ax21:elementValue>
					<ax21:id>407</ax21:id>
				</ax21:methodValues>
			</ns:return>
			<ns:return xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ax21:EntityObj">
				<ax21:entityId>1764241956</ax21:entityId>
				<ax21:entityTypeId>4</ax21:entityTypeId>
				<ax21:methodValues xsi:type="ax21:ValuePair">
					<ax21:elementValue>Accounting Intake</ax21:elementValue>
					<ax21:id>436</ax21:id>
				</ax21:methodValues>
				<ax21:methodValues xsi:type="ax21:ValuePair">
					<ax21:elementValue>In Progress</ax21:elementValue>
					<ax21:id>411</ax21:id>
				</ax21:methodValues>
				<ax21:methodValues xsi:type="ax21:ValuePair">
					<ax21:elementValue>IP: Execute</ax21:elementValue>
					<ax21:id>407</ax21:id>
				</ax21:methodValues>
			</ns:return>
                </ns:findEntityResponse>

 

 

And I'm able to convert it into this JSON

 

{
  "ns:findEntityResponse": {
    "@xmlns:ax21": "http://objects.services/xsd",
    "@xmlns:ns": "http://services",
    "ns:return": [
      {
        "@xsi:type": "ax21:EntityObj",
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "ax21:entityId": "168070803",
        "ax21:entityTypeId": "4",
        "ax21:methodValues": [
          {
            "@xsi:type": "ax21:ValuePair",
            "ax21:elementValue": "Project & Portfolio Management (PPM) Selection & Implementation",
            "ax21:id": "436"
          },
          {
            "@xsi:type": "ax21:ValuePair",
            "ax21:elementValue": "Complete",
            "ax21:id": "411"
          },
          {
            "@xsi:type": "ax21:ValuePair",
            "ax21:elementValue": "Complete",
            "ax21:id": "407"
          }
        ]
      },
      {
        "@xsi:type": "ax21:EntityObj",
        "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
        "ax21:entityId": "1764241956",
        "ax21:entityTypeId": "4",
        "ax21:methodValues": [
          {
            "@xsi:type": "ax21:ValuePair",
            "ax21:elementValue": "Accounting Intake",
            "ax21:id": "436"
          },
          {
            "@xsi:type": "ax21:ValuePair",
            "ax21:elementValue": "In Progress",
            "ax21:id": "411"
          },
          {
            "@xsi:type": "ax21:ValuePair",
            "ax21:elementValue": "IP: Execute",
            "ax21:id": "407"
          }
        ]
      }
    ]
  }
}

 

 

Once I parse the JSON, I know I'm probably supposed to do an Apply to each to iterate through ns:return and ax21:methodValue, but I'm unclear on how to transform this into something that I can trigger from Power Apps.

 

image.png

 

Then that gives me the correct data. For each entity ID (317 of them), I get three children elements (Title, Status, Phase).

 

Basically I want the collapse that data to look like this and be accessible in PowerApps.

 

IDTitleStatusPhase
168070803Project & Portfolio Management (PPM) Selection & ImplementationCompleteComplete
1764241956Accounting IntakeIn ProgressIP: Execute

 

Any assistance much appreciated. 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: XML to JSON to PowerApps Data Source

Hi @TroubledLlama ,

 

The PowerApps data source contains the local sources and the tables. You could create the data source in PowerApps with the local sources or tables.

 

I'm afraid that there is no any way to create the data source from the Microsoft flow data.

 

You could take a try to add the json data to the sharepoint list or excel table, then you could use the data as data source from the sharepoint list or tables.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: XML to JSON to PowerApps Data Source

Hi @TroubledLlama ,

 

The PowerApps data source contains the local sources and the tables. You could create the data source in PowerApps with the local sources or tables.

 

I'm afraid that there is no any way to create the data source from the Microsoft flow data.

 

You could take a try to add the json data to the sharepoint list or excel table, then you could use the data as data source from the sharepoint list or tables.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

Highlighted
Frequent Visitor

Re: XML to JSON to PowerApps Data Source


 

You could take a try to add the json data to the sharepoint list or excel table, then you could use the data as data source from the sharepoint list or tables.

 


I think this is pretty much what I will be looking to do. The app is going to be read only, so I really just need to periodically receive the data. Regardless, I believe I still need to find a way to flatten the data. Thank you.

Highlighted
Community Support
Community Support

Re: XML to JSON to PowerApps Data Source

Hi @TroubledLlama ,

 

Take a try to create the flow to add the item to sharepoint list.

 

Best Regards,

Alice

 

Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

Super User Program Update

Three Super User rank tiers have been launched!

firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Top Kudoed Authors
Users online (9,174)