cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JomarGF
Level: Power Up

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
JomarGF
Level: Power Up

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. 

6 REPLIES 6
Super User
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.
JomarGF
Level: Power Up

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
            )
      )

Super User
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.
JomarGF
Level: Power Up

Re: Gallery not showing filtered data until control is updated

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

Super User
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.
JomarGF
Level: Power Up

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. 

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 233 members 5,062 guests
Please welcome our newest community members: