web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Problem viewing Items ...
Power Apps
Answered

Problem viewing Items in a Gallery from a Collection with a Json Data Source

(1) ShareShare
ReportReport
Posted on by 23

Hi Everyone,

 

I am returning a multi-row json object (see screenshot/json below) from a flow into PowerApps via 

ClearCollect(mycollection,'exampleflow'.Run())

to load it into a collection. The collection populates as expected and I can see its contents when I view the collection in PowerApps collections explorer (see screenshot).

 

example.png

 

However when I set the gallery datasource as 'mycollection' and try to populate labels in the gallery via: 

ThisItem.Catalog.CD.Artist 

I get the following error message: "Expected Text Value". However, if I use:

First(ThisItem.Catalog.CD).Artist

then the gallery returns the first row from within the collection but none of the other rows for Bonnie, Dolly etc  (which I want to see!)

example3.PNG

 

It feels like I'm missing something very simple!! Does anyone have any ideas about how best to display a nested json collection data in a gallery????

 

Thanks!

 

---------------------------------------------

 

Here is the example json I am using:

 

{
 "CATALOG": {
 "CD": [
 {
 "TITLE": "Empire Burlesque",
 "ARTIST": "Bob Dylan",
 "COUNTRY": "USA",
 "COMPANY": "Columbia",
 "PRICE": "10.90",
 "YEAR": "1985",
 "ORACLE": "\n select * from scott.dept;\n "
 },
 {
 "TITLE": "Hide your heart",
 "ARTIST": "Bonnie Tyler",
 "COUNTRY": "UK",
 "COMPANY": "CBS Records",
 "PRICE": "9.90",
 "YEAR": "1988"
 },
 {
 "TITLE": "Greatest Hits",
 "ARTIST": "Dolly Parton",
 "COUNTRY": "USA",
 "COMPANY": "RCA",
 "PRICE": "9.90",
 "YEAR": "1982",
 "ORACLE": "\n begin\n htp.p('This is the test data');\n end;\n "
 },
 {
 "TITLE": "Still got the blues",
 "ARTIST": "Gary Moore",
 "COUNTRY": "UK",
 "COMPANY": "Virgin records",
 "PRICE": "10.20",
 "YEAR": "1990"
 }
 ]
 }
}

I have confirmed that the json is valid in a json validator

Categories:
I have the same question (0)
  • JohnP Profile Picture
    543 on at

    Set the label text to ThisItem.Artist

  • pwapp Profile Picture
    23 on at

    Hi,

    Thanks @JohnP , just tried that and i don't think it works unfortunately. Do you know why?

    Example:

    ThisItem.Artist

    Eror mesage is 'Name isn't valid. This identifier isn't recognized':

    example4.png

     

    I'm a bit stumped! I think this should be simple? Am i missing something obvious??

     

    Thanks 🙂

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @pwapp 

    I believe the issue here is that you are expecting to itterate over the Artist values in your gallery.  However, I'm guessing that you have the items property of the gallery set to your collection.

    This will itterate over all the records in the myCollection collection...to which there is only 1 record - CATALOG.

     

    If you change your Items property on the Gallery to First(myCollection).CATALOG.CD

    you will then be able to use things like ThisItem.Artist

    Based on your sample data, you have a single record with a CATALOG column that contains a table of records with a CD column, that contains a table/array of the information I believe you really want.

     

    See if that is helpful for you.

  • pwapp Profile Picture
    23 on at

    Hi @RandyHayes

     

    Ah, perfect! That works great thanks! Thanks for taking the time to explain how to pull it together - I didn't know you could amend the the items property like that.

     

    Thanks!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @pwapp 

    Yes, the Items property of a gallery just needs a table.  In this case, we are providing it a table that it wants, and it is at a level in the collection that makes sense for the information you want to display.

  • wsalling Profile Picture
    114 on at

    how are you getting the JSon back from powerapps so you can use it in a collection?  stuck at moment.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard