cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Gallery not showing filtered data until control is updated

Hi all

 

I have a gallery items based on a filter from a drop down. The items do not show when I first navigate to the page where the gallery resides. But when I start using the drop down, it works as expected. What am I missing? Thank you in advance. 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Helper II
Helper II

Re: Gallery not showing filtered data until control is updated

Solved. I have to make a hidden text box with the formula : Concat(ComboName.SelectedItems, Result)

and filter based on the value of the hidden text box as below:

 

Sort(
          If(
                IsBlank(txtTest.Text),
                collPropAssets,
                Filter(
                            collPropAssets,
                            TestingRoutineDesc in cmbCategory.SelectedItems
                         )
               ),
               AssetNo,
             If(
                 SortDescending1,
                 Descending,
                 Ascending
                )
      )

 

Please let me know of a better solution. 

View solution in original post

6 REPLIES 6
Highlighted
Dual Super User II
Dual Super User II

Re: Gallery not showing filtered data until control is updated

Would you post the Items property from the Gallery?  I suspect you are overfiltering the gallery until you pick an entry in the dropdown.  Its usually best to use an IF() statement for the Items property that adjusts if things like the dropdown are blank.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Helper II
Helper II

Re: Gallery not showing filtered data until control is updated

Hi Thank you for your reply. I have this formula in the Gallery.Items

 

cmbCategory (Dropdown control, multi select enabled)

 

Sort(
         If(
              IsEmpty(cmbCategory.SelectedItems.Result),
              collPropAssets,
              Filter(
                        collPropAssets,
                        TestingRoutineDesc in cmbCategory.SelectedItems
                      )
             ),
                AssetNo,
          If(
               SortDescending1,
               Descending,
               Ascending
            )
      )

Highlighted
Dual Super User II
Dual Super User II

Re: Gallery not showing filtered data until control is updated

I would double check on whether your selected items are actually throwing a True for IsEmpty when you enter the screen. It may be registering as Null at that point.  Otherwise the code looks right.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Helper II
Helper II

Re: Gallery not showing filtered data until control is updated

Can you give a suggestion on how can I check for that? Thanks!

Highlighted
Dual Super User II
Dual Super User II

Re: Gallery not showing filtered data until control is updated

What is the combox bound to for items?  I tried it with a local collection and can't replicate your issue.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Helper II
Helper II

Re: Gallery not showing filtered data until control is updated

Solved. I have to make a hidden text box with the formula : Concat(ComboName.SelectedItems, Result)

and filter based on the value of the hidden text box as below:

 

Sort(
          If(
                IsBlank(txtTest.Text),
                collPropAssets,
                Filter(
                            collPropAssets,
                            TestingRoutineDesc in cmbCategory.SelectedItems
                         )
               ),
               AssetNo,
             If(
                 SortDescending1,
                 Descending,
                 Ascending
                )
      )

 

Please let me know of a better solution. 

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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