web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / New App for Accessing/...
Power Apps
Unanswered

New App for Accessing/Manipulating SQL Server Table

(0) ShareShare
ReportReport
Posted on by
Good Morning,
 
What is the simplest way to make an App :
 
1) To retrieve records (i.e. SELECT).
2) To Update existing records.
3) To Insert new records.
 
Would it be better to use Power Apps or Power Automate (or in conjunction with each other ?). I would appreciate any tips for efficiently building the interface for searching the records also.
What licences would be required ?
 
Kind Regards
I have the same question (0)
  • Suggested answer
    VASANTH KUMAR BALMADI Profile Picture
    266 on at
    New App for Accessing/Manipulating SQL Server Table

    Hi,

    To create an app for accessing and manipulating a SQL Server table (including SELECT, UPDATE, and INSERT operations), Power Apps is the most suitable tool to create a user-friendly interface for accessing the data, while Power Automate can be used to automate processes if needed. Here’s how you can go about creating such an app, and the best practices for building it efficiently.

    1. Power Apps for Interface (Accessing/Manipulating SQL Server Data)

    Power Apps is ideal for creating the user interface and allowing users to interact with data from a SQL Server table.

    Steps for Power Apps:

    1. Set Up the SQL Server Connection:

      • Go to Power Apps Studio.
      • In the Data section, select SQL Server and configure a connection using your server credentials.
      • You will need to have the SQL Server connector in Power Apps, which may require a Premium License depending on your organization’s Power Apps plan.
    2. Retrieve Records (SELECT):

      • Use the SQL Server connector to fetch data from the SQL Server table.
      • Example:
        ClearCollect(Records, '[dbo].[YourTable]');
      • You can display the records in a Gallery control to show a list of the results.
    3. Insert New Records:

      • Use the Patch() function to insert new records.
      • Example:
        Patch('[dbo].[YourTable]', Defaults('[dbo].[YourTable]'), {
        Field1: TextInput1.Text,
        Field2: TextInput2.Text,
        Field3: TextInput3.Text
        });
      • This inserts a new row into the SQL Server table with values taken from input controls.
    4. Update Existing Records:

      • Use the Patch() function with a condition to update existing records.
      • Example:
        Patch('[dbo].[YourTable]', LookUp('[dbo].[YourTable]', ID = SelectedRecordID), {
        Field1: TextInput1.Text,
        Field2: TextInput2.Text
        });
      • This updates the fields for the selected record in your SQL Server table.
    5. Search Interface:

      • For efficient searching, use a Text Input control for search and filter the results based on user input.
      • Example:
        ClearCollect(FilteredRecords,
        Filter('[dbo].[YourTable]',
        TextSearchField1 & TextInputSearch.Text in FieldName));
      • This will search for records where FieldName contains the text entered in the search box.

    2. Power Automate for Additional Automation (Optional)

    If you need to automate processes (like sending notifications, triggering workflows, or updating related systems), Power Automate can be used in conjunction with Power Apps.

    • Triggering from Power Apps: You can use Power Automate to automate updates or other actions when triggered from Power Apps.
      • Example: When a user submits a new record or updates a record, trigger a Power Automate flow to send an email or perform other actions.

    Steps for Power Automate:

    1. Create a Power Automate flow that is triggered by Power Apps.
    2. Use SQL Server connector to perform the required operations (SELECT, INSERT, UPDATE).
    3. Use Power Apps to trigger the flow from the app using the Power Automate connector.

    3. Efficient Interface Design

    To make the app more efficient and user-friendly:

    • Use Galleries to display records efficiently.
    • Use Forms for creating and editing records.
    • Implement Search functionality using Text Input controls and filtering in galleries.
    • Data Validation: Make sure to add proper validation on input fields to ensure correct data is submitted.
    • Pagination: If there are large data sets, consider using pagination to limit the number of records displayed at once.

    Example of implementing pagination:

    ClearCollect(PagedRecords, FirstN(FilteredRecords, 100)); // Show first 100 records

    This will limit the number of records shown at once and improve performance.

    4. Licenses Needed

    • Power Apps: The ability to connect to SQL Server requires a Premium Plan license (either the Power Apps Per App Plan or Power Apps Per User Plan).
    • Power Automate: If you plan to automate processes or workflows with SQL Server or Power Apps, you will need a Premium license for Power Automate to use the SQL Server connector.
    • SQL Server: Make sure your SQL Server allows remote connections from Power Apps, and ensure the appropriate licensing for SQL Server (you might need an enterprise license for SQL Server if you're connecting remotely).

    License Details:

    • Power Apps Per App Plan: Includes premium connectors like SQL Server, but limits usage to 1 app per user.
    • Power Apps Per User Plan: Allows for unlimited apps per user with premium connectors.
    • Power Automate Per User Plan: Allows access to premium connectors for automating workflows.

    Conclusion

    • Power Apps is the ideal tool for creating a user interface to interact with your SQL Server database (for retrieving, updating, and inserting records).
    • Power Automate can be used to automate processes, especially when triggering workflows from Power Apps.
    • Efficient app design involves using controls like Galleries, Forms, and Text Inputs for searching and editing data, and using pagination and data validation techniques for better performance.
    • For SQL Server integration, a Premium Power Apps license is required, and you may also need a Premium Power Automate license if automating with SQL Server.

    By using Power Apps for the interface and Power Automate for additional workflows, you can create an efficient and powerful solution for managing data in your SQL Server table.

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard