Overview
In this article, we will learn how we can search for records from the SQL Server database and display the data within the PowerApps Forms.
So, now, let’s get started!
Prerequisites
- On-Premise SQL Server Connection
- On-Premise Data Gateway Installed
Use Case
I want to develop a simple search application using PowerApps which takes Order Number from the Search box and shows all the necessary information in a Grid.
Now, let’s get started!
Step 1 - Open PowerApps and Connect SQL Server Database with PowerApps
Step 2 - Add Textbox and Gallery Control for search and display the data
- Go to Insert menu and add Text Input.
- Go to Insert menu, from Gallery select Blank Vertical.
- Once Gallery has been added, it will show a formula in the formula bar.
- Edit the formula.
Add the following formula.
Filter('[dbo].[Order]',OrderNumber=TextInput1.Text)
Here, Filter = This formula will apply on Order table from SQL Server, where Order Number is equal to the user’s text input.
- Now, let’s add some labels in the Gallery to display the data.
- So, I added 4 labels for Order Number, Customer Id, Order Date, and Total Amount.
- Now, let’s test the application. Click on Preview the app.
- It shows the record for the searched number.
This is how we can easily create a simple Search application in PowerApps which fetches the records from SQL Server and displays the data in a Grid.
Conclusion
This is how we can connect SQL Server with PowerApps forms and perform Search Operations using Gallery and Textbox. I hope you love this article. Stay connected with me for more amazing articles.