cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
irsimeonov1
New Member

Can a wildcard be used to indicate 'all items' in a Filter function?

Hi

 

I am trying to understand whether I can somehow replicate Excel's * in a filter function so that the function returns all items in a table. For example Filter(TableName, Column1 = "*"), what do I need to put instead of the * so that the function returns all of the records in TableName?

 

Thanks

6 REPLIES 6
carlosag
Power Apps
Power Apps

There is no wildcard as such, but there are a few ways you could achieve that by for example using an "If" and return either the full datasource or a filter expression, or you can use an "Or" to check if it should return all of the rows, here is what I do:

 

	Filter(UserMessages, Email = Dropdown1.Selected.Value || Dropdown1.Selected.Result = "<All>" )

 

Thanks, that is a nice way to do it 🙂

Charles_John
Advocate II
Advocate II

This is old, but there is not a whole lot of documentation and help for PowerApps so i'm adding where i can.

 

I don't understand the "<All>" syntax of the accepted solution, so this is what I did:

 

Filter(
TargetTable,
If(
DropDown1.Selected.Value <> "[YourDefaultValue]",
DropDown1.Selected.Value = TableFilterColumn1,
TableFilterColumn1 in DropDown1Selections
),
If(DropDown2.Selected.Value <> "[YourDefaultValue]",
DropDown2.Selected.Value = TableFilterColumn2,
TableFilterColumn2 in DropDown2Selections
),
...
)

 

And you can continue the logic for how every many dropdown filters you want to use. Each dropdown when not equal to the first/default value will act as an AND filter for the returned table, which I use as the Items property of a gallery.

 

Be sure to set DropDown1 Items property = DropDown1Selections and DropDown2 Items property = DropDown2Selections. I Collect the two collections with a button.

 

BMALT
Frequent Visitor

Please explain, I don't understand how the "Or" statement is checking all the records

Filter(UserMessages, Email = Dropdown1.Selected.Value || Dropdown1.Selected.Result = "<All>" )

It looks like the filter resulting from the OR statement would either be
Filter(UserMessages, Email = Dropdown1.Selected.Value)
which is a valid filter, or it would be
Filter(UserMessages, Dropdown1.Selected.Result = "<All>")

which is not a valid filter, because the statement Dropdown1.Selected.Result = "<All>" doesn't have any relationship to the UserMessages table.

Westly
Advocate II
Advocate II

You can call the Data Source -> Column in the filter parameters using an if statement. I have added an example below.

Filter(
    Workflows,
    If(
        Len(my_ProgramComboBox.Selected.Result)>0,
        ProgramName = my_ProgramComboBox.Selected.Result,
        ProgramName in Workflows.ProgramName
    )
)

 

 

Filter(UserMessages, Dropdown1.Selected.Value = "<All>")

 

If you have a dropdown with <All> as a choice, the result should return "true", hence the formula will be Filter(UserMessage, true), or simply Filter(UserMessage), which return all result

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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