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

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

3 REPLIES 3
PowerApps Staff carlosag
PowerApps Staff

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

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

 

irsimeonov
Level: Powered On

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

Thanks, that is a nice way to do it Smiley Happy

Highlighted
Charles_John
Level: Powered On

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

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.