Skip to main content
Post a question

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id : CSTDQpci5f60X9Tl2CpAqa
Microsoft Dynamics 365 | Integration, Dataverse...
Suggested answer

Display JSON array in gallery

Like (3) ShareShare
ReportReport
Posted on 4 Feb 2025 08:53:19 by 266
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
    266 on 04 Feb 2025 at 14:12:27
    Display JSON array in gallery
     
    Adding .value after .Run() still gives me the same JSON parsing error, unfortunately.
  • Suggested answer
    Anthony Blake Profile Picture
    2,321 Super User 2025 Season 1 on 04 Feb 2025 at 13:25:12
    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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

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

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,760 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Product updates

Dynamics 365 release plans
Loading complete