cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TroubledLlama
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
v-alzhan-msft
Community Support
Community Support

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
v-alzhan-msft
Community Support
Community Support

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


 

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.

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
MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MSFTBizAppsLaunchEvent

Experience what’s next for Power Virtual Agents

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

New Super Users

Meet the Power Automate Super Users!

Many congratulations to the Season 1 2021 Flownaut Crew!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Users online (54,313)