To add a search field in a Canvas App in Microsoft Power Apps, we can follow these steps:
- Open the Canvas App in Power Apps Studio.
- From the left-hand pane, select the screen where you want to add the search field.
- Click on the “Insert” tab from the top menu and select “Text input” from the “Controls” section.
- Rename the text input control to “SearchBox” or something similar.
- Resize the text input control as per requirements.
- Click on the “View” tab from the top menu and select “Data sources” from the “Data” section.
- Click on the “Add data source” button and select the data source we want to search from.
- Select the data table or collection where we want to search from.
- Go back to the screen and select the “SearchBox” control.
- In the “Properties” pane on the right-hand side, scroll down to the “Advanced” section and expand the “OnChange” property.
- Add the following formula to the “OnChange” property:
- Filter(<Data source name>, <Column name> in SearchBox.Text)
- Replace <Data source name> with the name of the data source we added in step 7 and <Column name> with the name of the column you want to search from.
- Save the app and test the search functionality.
This will create a search field in your Canvas App that allows you to search for data in the specified data source based on the input entered in the search box.