Power Apps Repeating Tables: A Developer's Guide

Many business applications require users to enter multiple rows of related information within a single form. Examples include expense reports, purchase requests, project tasks, employee certifications, and invoice line items. Unlike traditional web applications, Power Apps does not provide a built-in repeating table control. However, by using Galleries and Collections, developers can create dynamic repeating tables that allow users to add, edit, and remove multiple records efficiently. Repeating tables are one of the most commonly used design patterns in Canvas Apps because they provide flexibility while maintaining a user-friendly experience.

What is a Repeating Table?

A repeating table is a data-entry structure where users can dynamically add multiple rows of information. Instead of creating fixed fields, users can continuously add rows as needed.

Example:

Item Quantity Price
Laptop 2 $1200
Monitor 3 $300
Mouse 5 $25

Common Business Scenarios

Why Use Galleries?

In Power Apps, Galleries act as repeating containers. Benefits include:

Each gallery item represents one row in the repeating table.

Step-by-Step Implementation

Step 1: Create a Collection

On screen load, use the OnVisible property to initialize a collection. This creates the first row in the repeating table.

ClearCollect( colLineItems, { ItemName: "", Quantity: 0, Price: 0 } )

Step 2: Insert a Gallery

Add a Vertical Gallery to your screen. Set its Items property to your collection (e.g., colLineItems). The gallery will now display the records from your collection.

Step 3: Add Input Controls

Inside the gallery template, add TextInput controls for each field (e.g., ItemName, Quantity, Price). Set the Default property of each input control to the corresponding field name from the collection (e.g., ThisItem.ItemName). This makes each row editable.

Step 4: Add New Rows

Insert a button (e.g., "Add Row"). Set its OnSelect property to collect a new blank record into your collection:

Collect( colLineItems, { ItemName: "", Quantity: 0, Price: 0 } )

Users can now add unlimited rows dynamically.

Step 5: Remove Rows

Add a delete icon inside the gallery template. Set its OnSelect property to remove the current item from the collection:

Remove( colLineItems, ThisItem )

Users can delete rows instantly.

Step 6: Calculate Totals

Add a label to display the total. Use the Sum function to calculate the total based on your fields:

Sum( colLineItems, Quantity * Price )

This provides real-time calculations.

Step 7: Save Data to SharePoint

To save the collection data to a SharePoint list, use the ForAll and Patch functions. This will create a new parent record for each row in the collection.

ForAll( colLineItems, Patch( PurchaseRequests, Defaults(PurchaseRequests), { ItemName: ItemName, Quantity: Quantity, Price: Price } ) )

All rows are stored automatically.

Step 8: Save Data to Dataverse

Similarly, you can save data to Dataverse. This typically involves creating child records linked to a parent record.

ForAll( colLineItems, Patch( 'OrderDetails', Defaults('OrderDetails'), { Product: ItemName, Quantity: Quantity, Price: Price } ) )

This creates child records in Dataverse.

Example Architecture

The typical architecture for a repeating table implementation in Power Apps is:

  1. User interacts with the form.
  2. Data is managed in a Gallery.
  3. The Gallery displays records from a Collection.
  4. Users can Add/Edit/Delete Rows within the Gallery.
  5. When submitting, the Collection data is saved to a Data Source (SharePoint/Dataverse).

Real-World Example: Purchase Order Application

Imagine a user entering items for a purchase order:

Best Practices

Benefits

Common Use Cases

Conclusion

Repeating tables are one of the most powerful UI patterns in Power Apps. By combining Galleries, Collections, and data sources such as SharePoint or Dataverse, organizations can create dynamic forms that allow users to add, edit, and remove multiple records seamlessly. This approach provides flexibility, scalability, and a modern user experience while supporting complex business requirements.