Thank you for visiting my site!

Home / PowerApps - Forms / How to search a List

How to search a List

Search

Create an new app empty, add a gallery connected to alist, add a textbox that we will use for searching.

—————————————————-

Change the Gallery Items to
Search([@’Zebra-Employee-Detail’],SearchBox.Text,”Title”,”Department”)
search the list columns Tile or department


Sort

Sort(Filter(‘Registration Form’,Course.Value=“Power Apps”),RegistrationDate)

Sort(Distinct(DS,’Columns to show’),Result) // in a dropdown

SortByColumns(Filter([@‘Registration Form’],Course.Value=“Share Point Online”), “Title”, Descending)


Add a Dropdown to show search results:
Distinct(‘Zebra-Employee-Detail’,Department)


for items properties use:
ShowColumns(Search([@’Zebra-Employee-Detail’],SearchBox.Text,”Title”), “Title”)

for gallery
Search([@’Zebra-Employee-Detail’],Dropdown2.Selected.Department,”Department”)
Filter(‘Zebra-Employee-Detail’, Department = Dropdown2.Selected.Result)


Filter

Change the Gallery Items to:
Filter(‘Zebra-Employee-Detail’,SearchBox.Text in Title) //Filter(Data Source,Condition) works on short list

Filter(‘Zebra-Employee-Detail’,StartsWith(Title, SearchBox.Text)) //Filter(Data Source,Condition)
add one more condition, it works like And
Filter(‘Zebra-Employee-Detail’,StartsWith(Title, SearchBox.Text),FavoriteColor = “Red”)

Filter(‘Zebra-Employee-Detail’,Department = Dropdown2.Selected.Department)

————————————————————–

Lookup

Returns the first record:

LookUp( IceCream, Flavor = “Chocolate”, Quantity )

LookUp(‘Zebra-Employee-Detail’, StartsWith(Title, SearchBox.Text)) //Filter(Data Source,Condition)


Search with a dropdown:

Set the dropdown items to:
Distinct(‘Zebra-Employee-Detail’,Department)

set the Gallery Items to:
Filter(‘Zebra-Employee-Detail’, Department = Dropdown2.Selected.Result)

Sum up Filtered column

Sum(Filter(‘datasource’, col.Value = “some text”), ‘col to add up’)


Checking if Record Exists

 

UpdateContext(
    {
        isMatch: If(
            CountRows(
                Filter(
                    BS,
                    'colName' = somField.Value
                )
            ) = 0,
            false,
            true
        )
    }
);

Get only the records that have a match

Filter(
    DB_Lookup,
    
    Title in Filter(
         DC, 'colName' = somField.Value
    )
)

Get only the records that does not have a match

Filter(
    DB_Lookup,
    Not(
        Title in Filter(
            DC,'colName' = somField.Value
       )
    )
)

ADD YOUR COMMENT