cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AFE2E
Regular Visitor

Powerapps collections - drill down through 3 levels?

Hi,

 

My app has a flow which imports several collections when a user logs in. One of these is named 'Park' and contains a 'Category' which I need a gallery to access. The issue is that this is on level 4 of the table structure. I need a gallery of the values in 'green' but can't seem to get to it. Any ideas?

 

 

7 REPLIES 7
StalinPonnusamy
Super User
Super User

Hi @AFE2E 

 

Looks like Categorydetail is a table. So we have to use First() even though you may have a single record.

 

Category: Park.category.First(categoryDetail).Text

 

Please share the error. It helps to troubleshoot.

 

Hi, 

 

I have tried your suggestion..

 

AFE2E_0-1632319250366.png

 

I get the following errors. 'Invocation of unknown or unsupported function' when hovering over the park.category section. Then I get 'Name isn't valid. The identifier isn't recognised' on categorydetail and 'Invalid use of '.' on /Text at the end

StalinPonnusamy
Super User
Super User

Hi @AFE2E 

 

Few troubleshoot items

  • Can you insert the label on the screen and set the text property to 

 

Park.category.categoryDetail.Text​

 

  • Can you Share Park and category structure?
v-qiaqi-msft
Community Support
Community Support

Hi @AFE2E

Have you solved your problem?

Do you want to add a record to your ParkCategories?

Could you please share more about your need, access this value in a Gallery or add it into a collection?

 

If you just want to access this in a Gallery, please set the Text property of the Label as below:

ThisItem.Category.CategoryDetail.Text

vqiaqimsft_0-1632466922137.png

 

If you want to get this value into another collection, please modify your Collect() formula as below:

Collect(ParkCategories,{Category:First(Park).Category.CategoryDetail.Text})

Note that you should determine which record in the Park do you want to access to, I assume that you want to access to the first record.

vqiaqimsft_1-1632467416444.png

 

Best Regards,
Qi

Hi, 

 

Thanks for your response. 

 

I'm trying to display a question bank based on the categories for each park. So the Park is collected when the user logs in. The categories are pulled from the DB in to a collection. Then I want to use a gallery to display the questions for the categories that this Park has assigned to it. 

 

I've tried both of your methods above and both work up to the point category.categoryDetail but the .Text is always underlined in red and says 'Name isn't valid' I just can't seem to get to that last level to extract the value. Please see my collection structure below...

 

ITBird_0-1632471933883.png

 

ITBird_1-1632471951522.pngITBird_2-1632471963293.png

 

 

StalinPonnusamy
Super User
Super User

Hi @ITBird 

 

I created a collection similar to you to test it.

ClearCollect(
    Park,
    {
        Key: 0,
        Address: {Street1: "900 Main St"},
        category: {
            organization: 1,
            categoryDetail: {
                Description: "Audit",
                Text: "First Aid",
                Key: 95
            }
        }
    }
);
Collect(
    ParkCategories,
    {Category: First(Park).category.categoryDetail.Text}
)

When I assign Park or Category to Gallery as Items property than to display "Text" column

ThisItem.category.categoryDetail.Text

And also able to collect the "Text" column to the ParkCategories collection

 

StalinPonnusamy_0-1632486355430.png

 

 Can you try this sample and see where the problem is.

StalinPonnusamy
Super User
Super User

Hi @ITBird 

 

Please let us know if anything needs on your post. We can help with this.


Please do not forget to give kudos if you find the suggestion helpful or Accept it as a solution if works fine to help other users to find it useful.

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,586)