Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Collection not showing any data

(0) ShareShare
ReportReport
Posted on by 158

Hi,

Maybe someone can help... so I have a gallery with data taken from Excel file. I am trying to filter gallery through parts and months so 2 filters applied on it. My code for Items in gallery is: 

Filter(Table5, ('PART NUMBER'=Dropdown1.Selected.Result), ('month' = Dropdown1_1.Selected.Result))

 

My code for first filter is: Distinct(Table5, 'PART NUMBER')

...and second filter is: Distinct(Table5, 'month')       

 

It all works well, the gallery filters through months and parts as I want but I can't manage to create collection and add option: show "All" in both filters. 

 

I tried with Collect(colparts, Distinct(Table5, 'PART NUMBER')  on Screen -> OnVisible and then change code on filter to colparts but it doesn't work and shows "We didn't find any data." for a collection.  I would appreciate any help and ideas amybe other solutions how I can see all options in filter other than collecting data, please 🙏

Categories:
  • MP-13011217-0 Profile Picture
    MP-13011217-0 158 on at
    Re: Collection not showing any data

    Hi, I tried this code for collection and seem to be working fine, just changed the one for gallery slightly - couldn't see it straight away I had to close the app and opened again. After I've done that I could see results 🙂 ! Thank You very much for Your time and solutions! 

  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Collection not showing any data

    @marcy_pi ,

    What type of field in month in Table5 ? Also look in View > Collections > colMonth - what do you see in the month field ?

  • MP-13011217-0 Profile Picture
    MP-13011217-0 158 on at
    Re: Collection not showing any data

    Hello again, 

     

    So I just copied Your codes but my second dropdown box is called Dropdown2_4 and here are my errors so exactly what You posted. I am surprised as well as it seem to work for everyone this solution when I check other forums or youtube... 

     

    marcy_pi_0-1654077354738.pngmarcy_pi_1-1654077399713.pngmarcy_pi_2-1654077423319.png

    am I missing something here, please? 

  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Collection not showing any data

    @marcy_pi ,

    The code is valid if your original posted code was and it is implemented as I posted. The collections are run at App OnStart and these are then the Items of your dropdowns. Can you please post (in Text) the exact code you are getting the error on and where you are using it.

  • MP-13011217-0 Profile Picture
    MP-13011217-0 158 on at
    Re: Collection not showing any data

    Thank You but now I have these errors: 

    marcy_pi_0-1653997852015.pngmarcy_pi_1-1653997882787.pngmarcy_pi_2-1653997900558.pngmarcy_pi_3-1653997920261.png

     

  • Verified answer
    WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Collection not showing any data

    Hi @marcy_pi ,

    Make two collections (App OnStart will do) - these will then be the Items of your dropdowns

    ClearCollect(
     colPart,
     {Result: "All"},
     Distinct(
     Table5, 
     'PART NUMBER'
     )
     );
     ClearCollect(
     colMonth,
     {Result: "All"},
     Distinct(
     Table5, 
     'month'
     )
    )

    Then the Items of the Gallery

    Filter(
     Table5,
     (
     Dropdown1.Selected.Result = "All" || 
     'PART NUMBER' = Dropdown1.Selected.Result
     ) &&
     (
     Dropdown1_1.Selected.Result = "All" || 
     'month' = Dropdown1_1.Selected.Result
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • MP-13011217-0 Profile Picture
    MP-13011217-0 158 on at
    Re: Collection not showing any data

    What I want is option "All" in a dropdown box so it could show me all parts in a specific month or all months for a specific parts depending on filters. I thought that I need to get all parts from a gallery and make a collection of it then assign them to "All" option in dropdown box but I struggle to do that... 

  • MP-13011217-0 Profile Picture
    MP-13011217-0 158 on at
    Re: Collection not showing any data

    Hello, 

    Thank You for Your response, it works the same as my codes, so still not showing me option "All" in a dropdown box but filters well through the gallery. 

     

  • WarrenBelz Profile Picture
    WarrenBelz 145,343 on at
    Re: Collection not showing any data

    Hi @marcy_pi ,

     I assume here you want all items displayed it there is not selection made in the drop-downs - if so try

    Filter(
     Table5,
     (
     Len(Dropdown1.Selected.Result) = 0 || 
     'PART NUMBER' = Dropdown1.Selected.Result
     ) &&
     (
     Len(Dropdown1_1.Selected.Result) = 0 || 
     'month' = Dropdown1_1.Selected.Result
     )
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

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

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,343

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard