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
Dual Super User

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
Dual Super User

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
Dual Super User

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

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (6,186)