I have a report screen where users can select a report to view. When they navigate to that screen, the gallery is remembering the results from the previous visit. The dropdown box is what populates the gallery.
I currently have the navigation set to:
I missed that. If that is the case you don't need the If statement.
So:
OnVisible:
UpdateContext({ResetCombo:!ResetCombo})
ComboBox:
Allow multiple selections - Off
Allow Searching - On
Items - Choices(DataSource.FieldName)
Reset - ResetCombo
Gallery:
Sort(Filter(DataSource, FieldName.Value=ComboBox1.Selected.Value),"SortField",Ascending)
This is for if the field you are looking at is a Choice Field as the column type. I just did a test on my side to make sure and this will pull up showing nothing in the gallery and once they select an option from the combo box that is all the gallery shows is the items that match that criteria.
Let me know if I missed anything or there is something else not working right on this. Sorry I got confused on your need.
I think I've mis-communicated. I want the gallery to show no items until something is selected from the dropdrown or combo box. When users navigate to this screen, I want it blank.
If you want it to show everything when nothing is selected in the combo box you would still need to do the if statement to allow it to not have a filter and for the filter part it would be ComboBox3.Selected.Value and the if statement part would be If(IsBlank(ComboBox3.Selected.Value), 'no filter', 'filter')
The reason the combo box works better than the drop down (in my opinion of course) is they can clear it out and select nothing but also because it has searching ability.
It will work with either the combo box or the drop down though you just have to use the if statement or the gallery will not show anything until something is selected from the box (whichever you use).
So then my gallery would filter on the combo box like this?
It would be Items=Choices(DataSource.FieldName) and turn off the "Allow Multiples" if it defaults to on because then it will interfere with the filtering abilities.
My CurrentStatus in my datasource is a Choice field. How would I do a combo box for that?
Using a hyphen is one way around it not allowing for a blank. If you are using that option then instead you need to do:
If(dd_CurrentStatus_1.Selected.Value="-",
Sort(DataSource, Organization, Ascending),
Sort(Filter(DataSource, CurrentStatus.Value=dd_CurrentStatus_1.Selected.Value),Organization, Ascending)
)
--- This is saying if the hyphen is selected don't filter, otherwise do. Same thing, just a variation on it. Make sure you get space or no space correct on that part in the quotes...it needs to match exact.
It's still not working. Is it because I have a hypen (-) in the dropdown menu and a hyphen (-) as an organization name? I have other screens that reset the value to blank, just not on my reports screens.
Here's where users navigate from:
Here's the screen that continues to show the gallery list even though nothing is selected in the dropdown:
A dropdown doesn't work well if you want them to be able to choose nothing. It won't really stay with a blank value and if they click on something it will never let them put it back to nothing again. Combo boxes work better for this.
That being said I think your issue might be more on what you have for the items of you gallery, you need to put an if statement in there or something that says to show everything if they haven't selected anything yet...change that to:
If(dd_CurrentStatus_1.Selected.Value="",
Sort(DataSource, Organization, Ascending),
Sort(Filter(DataSource, CurrentStatus.Value=dd_CurrentStatus_1.Selected.Value),Organization, Ascending)
)
This will tell it that if the drop down doesn't have anything selected yet show everything...otherwise do the filtering of it.
Thanks! I had update context but it wasn't working.
I tried the variable suggested but the gallery is still showing results even though the dropdown is "". Here's what I have for my gallery that displays the results of the current status dropdown:
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2