Introduction
Dynamic galleries in PowerApps allow you to present data in a flexible, user-friendly way. But what if your data source has too many columns, or you need to add calculated fields on the fly? This is where Table and Record functions come into play. Functions like AddColumns(), DropColumns(), RenameColumns() and ShowColumns() help you shape your data before displaying it in a gallery.
In this blog, we’ll explore these functions in detail and learn how to use them together to build dynamic galleries.
1. Understanding Table vs. Record Functions
Table: A collection of records (rows) with named columns.
Record: A single row of data with fields (columns).
PowerApps provides functions to manipulate tables and records so you can:
Add new columns for calculated values.
Remove unnecessary columns for better performance.
Rename columns for improved readability.
Select only the columns you need.
2. Key Functions Overview
Example Scenario
We have a collection named EmployeeDetails, which contains 4 employee records. You can use this collection as the data source for a gallery to display employee information dynamically.
ClearCollect(EmployeeDetails,
{ ID: 101, Name: "Alice", Department: "HR", Location: "New York" },
{ ID: 102, Name: "Bob", Department: "Finance", Location: "London" },
{ ID: 103, Name: "Charlie", Department: "IT", Location: "Sydney" },
{ ID: 104, Name: "Diana", Department: "Marketing", Location: "Toronto" }
)AddColumns()
Adds one or more columns to a table.
AddColumns(EmployeeDetails, "Region",
If(Location = "New York" || Location = "Toronto", "North America",
If(Location = "London", "Europe", "Asia-Pacific")
)
)
Here, we have add a column called Region based on Location.
DropColumn()
Removes columns you don’t need.
DropColumns(EmployeeDetails, ID)
This Remove the ID column from the EmployeeDetails collection.
RenameColumns()
Renames columns for better display names.




Join the conversation! Your thoughts help the community grow.