cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
aec2018
Microsoft
Microsoft

I can't get JSON from a Power Automate response to show up on my Canvas App as a table or even just a label. The most I get is 'true'.

My canvas app is connected to a Power Automate flow that makes an HTTP call to a GraphQL endpoint. The (edited down) response looks like this:

 

{
    "data": {
        "aWSPrices": [
            {
                "id": "229f8c1a-b0ad-490d-bbc5-1932437c571c",
                "offerCode": "AMAZONROUTE53REGIONALCHINA",
                "version": "20210422213356",
                "publicationDate": "2021-04-22T21:33:56.000Z",
                "productSku": "A2FBGTVWPQMCDBGT",
                "productFamily": "DNS Query",
                "productAttributes": null,
                "terms": null,
                "offerAttributes": null
            }]
     }
}

 

 

The schema in the Response step from the flow was generated automatically from this sample as such (I removed the 'required' attribute as mentioned in other posts):

 

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "aWSPrices": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "offerCode": {
                "type": "string"
              },
              "version": {
                "type": "string"
              },
              "publicationDate": {
                "type": "string"
              },
              "productSku": {
                "type": "string"
              },
              "productFamily": {
                "type": "string"
              },
              "productAttributes": {},
              "terms": {},
              "offerAttributes": {}
            }
          }
        }
      }
    }
  }
}

 

 

 

 

My current attempt is to return `body('HTTP').data.aWSPrices` so that just the array of objects is returned to my PowerApp and put into either just a label or a data table. I'm just trying to get any actual JSON data to show up in my PowerApp so that I can build from there and eventually turn this into either a gallery table or basic data table. I attempt to assign this response to a variable in a few different ways so far. This is from the OnSelect property of a button that calls the Power Automate:

 

Set(gqlCallResponse, aWSPrices_GraphQL.Run());
Set(gqlCallResponseJSON, JSON(gqlCallResponse));
ClearCollect(graphQLCallResponse, gqlCallResponseJSON);

 

 

 

 

I've tried mapping gqlCallResponse, gqlCallResponseJSON, and graphQLCallResponse to either a lable or a data grid and none have worked. The only thing I get is a 'true' value in the label (it starts as false until I click the button). The data table then only has one field that I can select which is the 'true' field. I set the Items property to graphQLResponse but that doesn't work either.

 

aec2018_0-1632941601854.png

 

 

I'm pretty lost at this point on how to get this response into my canvas app so that I can build a table from it. Any ideas? 

 

 

1 REPLY 1
Anousha
Frequent Visitor

When you run your flow try ClearCollect(MyDataTable, aWSPrices_GraphQL.Run().data); That should bring in your json data into a collection.

 

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!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,084)