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.
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?
When you run your flow try ClearCollect(MyDataTable, aWSPrices_GraphQL.Run().data); That should bring in your json data into a collection.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
199 | |
71 | |
49 | |
41 | |
30 |
User | Count |
---|---|
266 | |
121 | |
94 | |
90 | |
81 |