Hello,
I have spent too much time today seeking out the answer to my issue.
I am unable to post screen shots so will best describe visually and with code.
I have a simple power-app, it does not have any form - the purpose is to search the sp list based on filters, show the filtered gallery and then when hitting "pdf" you get the pdf of that current gallery emailed.
All is working the way it should - the html was miserable as I built in caveats for IsBlank() sp values and the pdf cuts off at the bottom which is another whole issue (happy for suggestions).
The left side of the app are 4 filters, all dropdowns. 1 of the filters is based on difference between dropdown selected and the current date, that works fine. The other 3 filters are exactly the same, but a different column.
Taking just one of those filters, I have the following
Default : "All"
Items:
UnGroup(
Table(
{MyTables: Table({Value: "All"})},
{
MyTables: SortByColumns(
Distinct(
ListName,
ColumnName.Value
),
"Value"
)
}
),
"MyTables"
)
====
My ColumnName is a choice column with blank values in it. The dropdowns show: [(Blank), "All", and the Choices]
I want it to show: ["-", "All", and the Choices]
Everywhere I look is getting a blank INTO the drop down, but I want to "rename" the blank item in the drop down.
Thanks in advance.
Great! two things I did wrong was flip my "All" on the other side and forget to put in the "-" statements.
Now I am adjusting the syntax for the gallery.items.
Before I had a Sort(Filter("series of or statements based on each filter"). Now with the suggestion of "If" statement, my "Or" statements are shouting at me.
I do not know how to and the internet is not helpful, to write the code like you have. My code is on work laptop which I cannot screen shot to email out of contacts to post.
The issue is I have 4 filter dropdowns
AllDrpDown which is collections of dates such as "last month", "last 3 months", "All time" etc
The line i included in my gallery.items.sort.filter formula is
Created >= AllDropDown.Selected.EndDate && Created <= AllDrpDown.Selected.StartDate
Another dropdown has ["All", "status1", "status2", "status3"] and this is called StatusDrpDown
The third dropdown is the one referenced in og post is called PriorityDrpDown and contains ["All", "-", "prior1", "prior2", "prior3"]
The final dropdown is also referenced above and is called LeadDrpDown and contains ["All", "-", "Name1", "Name2", "Name3"]
How do I use the above If statement, but include each dropdown in a filter, sorted by Created, Descending. I struggle with nested filters.
Any helpful hints for getting nested or multiple filters into my brain would help.
Thanks so far.
good that it helped u a bit at least haha
for the further handling try this:
Default: "All"
Items:
UnGroup(
Table(
{MyTables: Table({DisplayValue: "All", Value: "All"})},
{
MyTables: AddColumns(
SortByColumns(
Distinct(
ListName,
ColumnName.Value
),
"Value"
),
"DisplayValue",
If(IsBlank(Value), "-", Value)
)
}
),
"MyTables"
)
Adjust your gallery's Items property to correctly interpret the selection. If "All" is selected, the filter should show all items. If "-" is selected, it should only show items where the specific column is blank.
Assuming Gallery1 is your gallery and Dropdown1 is your dropdown, the filter logic might look something like this:
If(
Dropdown1.Selected.Value = "All",
ListName, // Show all items when "All" is selected
Dropdown1.Selected.Value = "-",
Filter(ListName, IsBlank(ColumnName)), // Show items where ColumnName is blank
Filter(ListName, ColumnName = Dropdown1.Selected.Value) // Regular filter for other cases
)
This logic checks the dropdown's selected value and applies the appropriate filter: showing all items, showing items with blank column values, or filtering based on the selected value.
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings
fantastic idea - the addcolumns is interesting spin
Before the addcolumns my table was:
after making the change I now have:
With my dropdowns being the items in Value column
I changed the code like from
{MyTables: Table({Value: "All"})},
to
{MyTables: Table({DisplayValue: "All"})},
and the value (under properties menu) I changed from "Value" to "DisplayValue"
By doing this, my drop downs are all golden,
but my items to display, when selecting "All" are only 4 when there should be 54, as there was with my original code.
Any thoughts why this is happening? Is it because my "All" is just a display "name" and not worth anything? in that case why is "-" == "All". The items when selecting either are the ones that should be under "-" (the ones blank in that column)
If I keep {MyTables: Table({Value: "All"})} and properties:value = "DisplayValue", then i lose "All" in my dropdown - having two (Blanks).
Try this
Default: "All"
Items:
UnGroup(
Table(
{MyTables: Table({Value: "All"})},
{
MyTables: AddColumns(
SortByColumns(
Distinct(
ListName,
ColumnName.Value
),
"Value"
),
"DisplayValue",
If(IsBlank(Value), "-", Value)
)
}
),
"MyTables"
)
Let me know if my answer helped solving your issue.
If it did please accept as solution and give it a thumbs up so we can help others in the community.
Greetings
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2