Building and Connecting Forms to Table Data in Power Apps

Power Apps empowers organizations to rapidly develop business applications with minimal coding. A common requirement in a Canvas App is creating a form that allows users to enter, edit, and manage data stored in a table. Forms provide an intuitive way to connect users with essential data sources such as Dataverse, SharePoint Lists, Excel files, and SQL Server tables, among many other connectors.

By leveraging forms, organizations can create robust solutions like employee management systems, customer portals, inventory applications, and service request systems. Power Apps forms are specifically designed to facilitate the creation, editing, and display of records from connected tables and data sources. In this article, we'll explore how to build a form from scratch and seamlessly connect it to table data within Power Apps.

What is a Form in Power Apps?

At its core, a Form is a control within Power Apps that serves as the primary interface for users to interact with data. It acts as a structured gateway for input, display, and modification of information.

Consider an Employee Registration Form as a practical example. Through such a form, users can perform several key data operations:

The typical workflow involving a form is straightforward:

User Input → Form Control → Connected Table → Store Data → Display Records

Why Use Forms in Power Apps?

Forms offer significant advantages for application development and user experience:

Form Architecture Overview

Understanding the underlying architecture helps in building effective forms. The flow is generally as follows:

Canvas App → Form Control → Data Source → Table → Store Records

Power Apps forms work directly with tables and records stored in connected data sources, acting as a bridge between your app's UI and your backend data.

Building a Form in Power Apps: A Step-by-Step Guide

Let's walk through the process of creating an employee registration form that captures and manages employee information, storing it in a Dataverse table and displaying records in a gallery.

Step 1: Create a Canvas App

Begin by setting up your Power Apps environment:

  1. Navigate to make.powerapps.com.
  2. From the left navigation pane, select Apps, then click + New app > Canvas.
  3. Choose either Tablet Layout or Phone Layout based on your application's primary usage. For this example, a tablet layout is suitable.

Step 2: Create a Table in Dataverse

Dataverse provides a secure and scalable platform for your application's data. We'll create a new table to store employee details:

  1. In the Power Apps maker portal, select Tables from the left navigation.
  2. Click + New table.
  3. Name your table, for instance, EmployeeDetails.
  4. Add the necessary columns (fields) to this table:
    • EmployeeName (Text)
    • Email (Text/Email)
    • Department (Text)
    • PhoneNumber (Text)
    • Location (Text)
  5. Save the table. Dataverse tables can be created directly within the Power Apps interface, streamlining your development process.

Step 3: Connect Your Data Source

Now, connect your newly created Dataverse table to your Canvas App:

  1. In your Canvas App studio, select Data from the left navigation.
  2. Click + Add data.
  3. Search for and select Dataverse.
  4. From the list of available tables, choose your EmployeeDetails table.

Power Apps supports multiple data sources that store information as tables and records, making it highly flexible.

Step 4: Insert and Configure an Edit Form

The Edit form control is central to data entry and modification:

  1. Go to Insert from the top menu, then expand Forms, and select Edit form.
  2. Rename the form control to something descriptive, like frmEmployee.
  3. With frmEmployee selected, go to the Properties pane on the right. Set its DataSource property to your EmployeeDetails table.

Forms automatically connect to the selected table, inferring the available fields.

Step 5: Add Fields to Your Form

Once the form is connected to the data source, you can add the specific fields you want users to interact with:

  1. With frmEmployee selected, click Edit fields in the Properties pane.
  2. Click + Add field and select the columns you created in Step 2: EmployeeName, Email, Department, PhoneNumber, and Location.

Your form will now display input controls for each of these fields, creating your basic employee entry form.

Step 6: Set the Form Mode

The form's mode dictates its behavior (new record, edit record, view record). For creating new records, set the DefaultMode property of frmEmployee:

Other useful modes include:

Step 7: Add a Submit Button

A button is needed to save the data entered into the form:

  1. Go to Insert > Button.
  2. Set the button's Text property to "Submit".
  3. Set the button's OnSelect property to:SubmitForm(frmEmployee)

The SubmitForm() function sends the data from the form controls to the connected table. The workflow is: User Enters Data → Submit Button → SubmitForm() → Save Record.

Step 8: Display a Success Message

Provide user feedback after a successful submission:

  1. Select frmEmployee.
  2. Go to its OnSuccess property (this property fires when SubmitForm() completes successfully).
  3. Set it to:Notify("Record Saved Successfully", NotificationType.Success)

This will display a green notification banner, confirming the record has been saved.

Step 9: Add a Gallery to Display Records

To see the saved records, add a gallery:

  1. Go to Insert > Gallery > Vertical gallery.
  2. Rename the gallery to galEmployees.
  3. Set the gallery's Items property to:'EmployeeDetails'

This gallery will now display all records from your EmployeeDetails table. Gallery controls are commonly used to display records from connected tables in a flexible and customizable layout.

Step 10: Enable Editing of Existing Records

To allow users to edit records directly from the gallery:

  1. Select the gallery (galEmployees).
  2. Set the OnSelect property of the gallery (or an icon within the gallery template) to:EditForm(frmEmployee); Select(Parent)
  3. Select frmEmployee.
  4. Set its Item property to:galEmployees.Selected

Now, when a user selects an item in the gallery, the form will switch to EditMode and populate with the details of the selected record. The workflow is: Select Record → Load Form → Edit Data → Save Changes.

Step 11: Create a "New Record" Button

To allow users to clear the form and start a new entry:

  1. Insert another Button.
  2. Set its Text property to "New Employee".
  3. Set its OnSelect property to:NewForm(frmEmployee)

This will reset frmEmployee to its NewForm mode, presenting a blank form ready for a new entry.

Step 12: Add a Reset Form Functionality

Sometimes, users might want to discard changes or clear fields without submitting:

  1. Insert another Button.
  2. Set its Text property to "Clear Form".
  3. Set its OnSelect property to:ResetForm(frmEmployee)

This function clears all fields in the specified form, reverting them to their initial state.

Real-World Applications of Power Apps Forms

The principles learned above are foundational for a wide range of business applications:

Employee Registration System

This system allows employees to register and update their information. Key fields include EmployeeName, Email, Department, and PhoneNumber. The workflow involves entering information, submitting the form, storing data in Dataverse, and displaying all employees in a gallery, creating a comprehensive employee database.

Customer Management Application

Forms are essential for CRM solutions. Fields like CustomerName, Email, Phone, and Address can be captured. Functions include creating, editing, deleting, and viewing customer records, resulting in a custom CRM application built on Power Apps.

Help Desk Ticket System

Users can create new support tickets with fields such as TicketTitle, Description, Priority, and Status. The workflow includes creating a ticket, submitting it, storing the record, and assigning it to a technician, leading to efficient support ticket management.

Common Form Functions in Power Apps

These are the core functions you'll use when working with forms:

Best Practices for Power Apps Forms

To build robust and user-friendly forms, consider these best practices:

Common Challenges and Solutions

Even with best practices, you might encounter issues:

Benefits of Building Forms in Power Apps

The effort invested in mastering forms yields significant benefits:

Conclusion

Building forms and connecting them to table data is one of the most fundamental and powerful skills in Power Apps development. Forms provide an efficient and user-friendly way to collect, edit, and display information while seamlessly integrating with a multitude of data sources like Dataverse, SharePoint, SQL Server, and Excel.

Whether you're developing sophisticated employee management systems, dynamic customer portals, efficient inventory applications, approval workflows, or comprehensive CRM solutions, Power Apps forms offer a fast, scalable, and professional way to manage business data and deliver exceptional user experiences. By following this guide, you now have the foundational knowledge to create powerful data-driven applications tailored to your organization's needs.