In this post, I will show you how to create a search box that lets you type a few letters and jump straight to what you need.

For this demo, I used a document folder on one of my SharePoint sites to test the search functionality I will demonstrate.

Let’s get started right away.

Navigate to the makers portal at https://make.powerapps.com.

On the left-hand side pane, select Insert, then Text input

and then choose to Insert a Vertical Gallery 

Select the data source from which you want your search box to search and bring back results (as I already mentioned, I used a SharePoint document library)

Now that I have everything I need, it’s time to write two lines of code to enable the search.

Open the Gallery, then select the “Items” property from the property selector drop-down menu in the top-left corner. After that, paste the code below into the formula bar.

Documents is the document library where I store files.

Filter(
    Documents,
    StartsWith(
        'Name',
        txtinpt_searchbox.Text
    )
)

The image below shows how the code will appear.

The yellow squiggles mean there’s a warning. Power Apps can’t look for all the data on the server. It only gets the first 500 records and types them on your device. This means some files might not show up in your search.

That’s it, now if you test it you will get the results below.

For my demo search, I typed “HR” and the result was to fetch the HR Demo FAQ.docx file from the SP document library.

 

Share This