Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Display JSON array in gallery

(2) ShareShare
ReportReport
Posted on by 193
Hello!
 
I have set up a simple flow that returns the following JSON:
 
[
{
"id": "Wakefield.7",
"partitionKey": "Italy",
"Country": "Italy",
"parents": [
{
"familyName": "Wakefield",
"firstName": "Robin"
},
{
"familyName": "Miller",
"firstName": "Ben"
}
],
"children": [
{
"familyName": "Merriam",
"firstName": "Jesse",
"gender": "female",
"grade": 8,
"pets": [
{
"givenName": "Goofy"
},
{
"givenName": "Shadow"
}
]
},
{
"familyName": "Miller",
"firstName": "Lisa",
"gender": "female",
"grade": 1
}
],
"address": {
"state": "NY",
"county": "Manhattan",
"city": "NY"
},
"isRegistered": false,
"_rid": "OftWAObFzHYDAAAAAAAAAA==",
"_self": "dbs/OftWAA==/colls/OftWAObFzHY=/docs/OftWAObFzHYDAAAAAAAAAA==/",
"_etag": "\"00003401-0000-3200-0000-67a111f00000\"",
"_attachments": "attachments/",
"_ts": 1738609136
}
]
 
The sample is an array, which I seem to struggle displaying in PowerApps.
I tried adding a Text Input field, and pasting the JSON in there, then displaying that in a Gallery, and that seems to be working just fine by adding this to the Items of the gallery: 
Table(ParseJSON(TextInput.Text))
 
However, when I try to get the items from a flow, I am facing a bit of an issue, and I am not quite understanding how I can manage to display these items in a gallery.
ClearCollect(myCollection, GetAllItems.Run()) gives me an error saying "JSON parsing error, expected 'object' but got 'array'"
Then I tried doing 
ClearCollect(myCollection, Table(Getallitems.Run()))
That gives me a table in my PowerApps variables, but when I add myCollection to the items of the gallery, and then try to display the id in a label, I get the same JSON parsing error.
 
How can I display the data in this JSON array in a Gallery?
Categories:
  • Hagru Profile Picture
    Hagru 193 on at
    Display JSON array in gallery
     
    Adding .value after .Run() still gives me the same JSON parsing error, unfortunately.
  • Suggested answer
    Anthony Blake Profile Picture
    Anthony Blake 2,298 Super User 2025 Season 1 on at
    Display JSON array in gallery
    Hi @Hagru
     
    Please could you try adding ".value":
     
    ClearCollect(myCollection, GetAllItems.Run().value)
     
    Anthony

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,160 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans