Master the Power Apps Gallery Control

If you've spent any time building a Power App, you've definitely come across the gallery control. But what is it, really?
Think of a Power Apps gallery as a container that displays a list of records from a data source like SharePoint or Dataverse. It's not just a boring table; it’s a dynamic, repeating layout where each row shows off a single item—complete with text, images, and even interactive buttons.
What Is A Power Apps Gallery And Why It Matters
Honestly, the gallery is the visual heart of almost every canvas app I build. It’s what turns raw, backend data into something a user can actually see, scroll through, and interact with. It's the difference between a static spreadsheet and a dynamic product catalog, a living task list, or a searchable employee directory.
Its main job is to show multiple records from whatever data source you connect to its Items
property. As per Microsoft's documentation, a gallery is the only control that can create other controls, making it fundamental for displaying sets of data.
Getting comfortable with galleries is one of the most important first steps in your Power Apps journey. It’s where data visualization and user interaction collide. Without it, you’d be stuck showing just one record at a time, which isn't very practical for most business needs.
The Foundation Of Interactive Apps
The real magic of a gallery is its template-based design. You only have to design the first row—the template. Every label, image, or icon you place in that template is automatically repeated for every single record in your data source. This is a massive time-saver and makes building complex, consistent layouts incredibly efficient.
Here's why galleries are so critical:
- Data Display: It’s your go-to tool for showing lists of information from just about any data source you can connect to.
- User Interaction: Galleries are built for interaction. Users can select items to see more details on another screen, trigger a Power Automate flow, or edit a record directly.
- Scalability: When you set them up right, galleries can handle thousands of records smoothly without bogging down your app's performance.
The image below shows a classic vertical gallery layout—probably the one you'll use most often. It's a simple list with images and some text labels.

This basic structure is your starting point. From here, you can customize everything to create an intuitive and responsive interface for your users. If you're new to the platform and want to get a solid handle on the basics, our complete https://samtech365.com/power-apps-tutorial/ is a great place to start.
Adapting To Modern Demands
With more and more people using apps on their phones and tablets, building for different screen sizes is no longer optional. The gallery control is surprisingly flexible here. You can configure it to adapt its layout based on the device, ensuring a great user experience everywhere.
This responsiveness is a key reason for the 82% increase in organizations turning to low-code platforms like Power Apps—they need to build and deploy business apps faster than ever, and flexible controls like the gallery make that possible.
Connecting Your Gallery to a Data Source
An empty Power Apps gallery is just a placeholder; the real magic happens when you connect it to your business data. This is what breathes life into your application, turning a static layout into a dynamic, interactive list of information.
The key to this entire operation is one single property on your gallery control: the Items
property.
Think of the Items
property as the gateway to your data. By simply pointing this property to a data source, you tell Power Apps exactly what information to display. The syntax is usually dead simple—often just the name of your SharePoint list or Dataverse table, like Items = 'Sales Leads'
or Items = 'Project Tasks'
.
Once you set this property, Power Apps immediately populates your gallery, repeating the template for each record it finds in the source.
Choosing Your Data Connection
Before you can set the Items
property, you first need to tell your app where the data lives. Power Apps supports a ton of connectors, but for most business apps, you'll likely be working with SharePoint lists and Dataverse tables. You can add these connections right from the "Data" pane in the Power Apps Studio.
The simple process flow below shows the basic steps to get your gallery up and running with live data.
As you can see, connecting a data source is the central step that bridges the gap between adding a control and configuring its appearance. If you're new to Dataverse, I highly recommend checking out our complete guide on what the Common Data Service (now Dataverse) can do for you.
The platform's growth has been explosive. By the end of 2024, Power Apps was being used by over 25 million monthly active users worldwide, which is a 40% increase in just two years. This incredible adoption is driven by its powerful ability to connect directly to sources like SQL Server, SharePoint, and Dataverse, allowing galleries to show live data for real-time monitoring.
The Critical Role of Delegation
Connecting data is easy, but doing it efficiently is what separates a good app from a great one. This is where delegation comes into play. In a nutshell, delegation is the process of letting the data source—like SharePoint or Dataverse—do the heavy lifting of processing your data (think sorting and filtering) before it sends the results back to your app.
Key Takeaway: If a task isn't delegable, Power Apps pulls the first 500 records (by default, up to 2,000) into your app and then tries to process the data locally. For a list with 10,000 items, this means your app could show incorrect results or, just as bad, perform at a snail's pace.
Understanding which functions are delegable for your specific data source is non-negotiable if you want to build scalable apps. Functions like Filter
, Search
, and SortByColumns
are often delegable, but support can vary based on the complexity of your formula and the source itself. It's always a good idea to have Microsoft's official delegation documentation handy.
Designing Custom Gallery Layouts
Let's be honest, the default gallery layouts are a decent starting point, but they won't win any design awards. If you want to elevate your app from simply functional to genuinely professional, you have to roll up your sleeves and customize the gallery's template.
Think of the template as the master blueprint for every single item in your gallery. Moving beyond the out-of-the-box options means you're taking direct control over all the controls inside that template. You can add, remove, and meticulously arrange labels, images, shapes, and icons to build a layout that perfectly fits what your app needs to do. The best part? The template is just the first item in your gallery—any change you make there instantly ripples across every other record.

Building a Practical Contact Card Layout
Imagine you're building a simple contact list. A standard "Title and subtitle" layout just feels flat and impersonal. A much better approach is to create a custom 'contact card' that's not only more visually appealing but also packs in more useful information at a glance.
To get started, just select the very first item in your gallery. This puts you into template-editing mode. From there, it's all about adding and configuring your controls.
- Bring in a Profile Picture: Drop an
Image
control on the left side of the template. Set itsImage
property toThisItem.ProfilePicture
to pull in the user's photo. - Arrange the Text Labels: Next, add two
Label
controls. For the top one, set itsText
property toThisItem.FullName
and give it a bold font weight to make the name stand out. The label right below it can showThisItem.JobTitle
. - Add Some Visual Cues: Why stop there? You can insert a small
Icon.Mail
next to another label showingThisItem.Email
. It’s a small touch, but it makes the UI much more intuitive.
This kind of design transforms a boring list into a clean, modern directory. And if you find yourself building these kinds of UIs often, I highly recommend looking into a component strategy in Power Apps. It can save you a massive amount of time in the long run.
Mastering Spacing and Flow with Key Properties
A great layout isn't just about what you put in it; it's also about how everything is spaced and arranged. Getting the flow right is crucial for a polished look, especially when your app will be used on different screen sizes. Two properties are your best friends here.
Getting a handle on these core properties is fundamental to building responsive and high-performing apps. They provide the granular control needed to perfect the user experience.
TemplateSize
: This one is straightforward. It controls the height of each row in a vertical gallery or the width of each column in a horizontal one. Setting it to a fixed number, like 120, keeps every item perfectly uniform.WrapCount
: This property is specifically for horizontal galleries. It dictates how many items will sit in a single row before the gallery "wraps" to the next line. SettingWrapCount
to 4 creates a neat four-column grid that automatically reflows as the screen width changes.
By simply tweaking these two properties, you can effortlessly switch between a compact list and a more spacious grid. The real magic happens when you combine a calculated TemplateSize
with a dynamic WrapCount
—that's the secret sauce for building a gallery that looks fantastic on any device, from a huge desktop monitor down to a smartphone.
Making Your Gallery Interactive with Smart Filtering and Sorting
A gallery that just shows data is fine, but one that lets users interact with that data? That's where the magic happens. Turning a static list into a powerful, user-driven tool is all about giving people the ability to find exactly what they're looking for. Let's dig into the essentials: dynamic filtering and user-controlled sorting.

The secret sauce here is manipulating the gallery's Items
property with a bit of Power Fx. Instead of just pointing it directly to our 'Support Tickets'
data source, we're going to wrap it in functions that respond to what users do in search bars, dropdowns, and buttons.
Building an Instant Search Bar
A search bar is almost a reflex for users—it's the first thing they look for when faced with a list. Good news: adding one is incredibly straightforward and delivers a huge win for user experience.
First up, drop a Text input
control onto your screen. Give it a sensible name you'll remember, something like txtSearchInput
. Now for the fun part. Select your gallery, find its Items
property, and pop this formula in:
Search(
'Support Tickets',
txtSearchInput.Text,
"Title",
"Description"
)
That’s it! This little snippet tells Power Apps to sift through the 'Support Tickets'
data, looking for whatever text is in txtSearchInput
. It'll check both the "Title" and "Description" columns, and the best part is, the gallery updates in real-time as the user types.
Adding Category Filters with a Dropdown
General search is great, but sometimes users need to zero in on specific categories, like a ticket's status or priority. A Dropdown
control is your best friend for this job.
Let's assume our 'Support Tickets'
list has a 'Status' column with choices like "New," "In Progress," and "Resolved." Here's how to wire it up:
- Add a Dropdown: Place a dropdown control on your screen and name it (e.g.,
ddStatusFilter
). - Populate the Choices: Go to its
Items
property and give it a list of options. You can hardcode them or, even better, pull them dynamically from your data source. For now, let's keep it simple:["All", "New", "In Progress", "Resolved"]
. - Update the Gallery's Formula: Now, we'll introduce the
Filter()
function to slice our data.
Filter(
'Support Tickets',
ddStatusFilter.Selected.Value = "All" || Status.Value = ddStatusFilter.Selected.Value
)
This formula is pretty clever. It looks at what's selected in the dropdown. If the user picks "All," it knows to show everything. Otherwise, it only shows the tickets where the Status
column actually matches the selection.
The Power Apps community is always coming up with better ways to handle this stuff. I've seen some amazing techniques at user groups for making filtering super-efficient, especially with huge datasets. People share tips on everything from dynamic filtering and responsive layouts to advanced selection methods that don't bog down the app with thousands of records. It's worth checking out community forums to see how the pros build seriously scalable apps.
Enabling Dynamic Sorting
The final piece of the puzzle is letting users organize the data their way. A couple of buttons to sort by date or name is a classic, effective touch. We'll use the SortByColumns()
function combined with a variable to keep track of the sort order.
First, add two icons or buttons—one for sorting A-Z and another for Z-A. To set things up, go to the screen's OnVisible
property and initialize a variable: UpdateContext({sortDescending: false})
.
Next, wire up the OnSelect
properties for your buttons:
- Ascending Button:
UpdateContext({sortDescending: false})
- Descending Button:
UpdateContext({sortDescending: true})
Finally, wrap your entire gallery Items
formula—the one with the Filter()
logic—inside SortByColumns()
:
SortByColumns(
Filter(...your filter logic...),
"Title",
If(sortDescending, Descending, Ascending)
)
This powerhouse formula does it all. It first filters the data based on your search and dropdown controls, and then it sorts the results by the "Title" column. The direction is controlled by our sortDescending
variable, giving the user total command over how they view the data.
Using Advanced Styling and Conditional Formatting
Styling is more than just a fresh coat of paint for your Power Apps gallery; it’s how you make it visually intelligent. By tapping into Power Fx, you can apply formatting that reacts to your data, turning a simple list into a smart dashboard that tells users exactly where to look.
This is what separates a decent app from a truly polished, professional solution. Instead of a static, boring list, your gallery comes alive. It can change colors and styles on the fly to communicate critical information at a glance. Imagine a task list that automatically highlights overdue items in red, or a sales pipeline that flags high-value leads in green.
Applying Data-Driven Conditional Logic
The real magic behind this is using If()
statements inside the property fields of the controls in your gallery template. This lets you dynamically change colors, visibility, and even text based on the data in the current record, which we reference as ThisItem
.
Let's take a project management app as an example. You’d want to quickly show which tasks are done, which are late, and which are on track. To pull this off, you'd select a Label
control inside your gallery template and head over to its Color
property.
The formula might look something like this:
If(
ThisItem.Status.Value = "Completed",
Color.Green,
ThisItem.DueDate < Today(),
Color.Red,
Color.Black
)
This little expression packs a punch. It checks each item's status and tells Power Apps: if a task is marked "Completed," make the text green. If it's not completed and its DueDate
is in the past, turn it red. For everything else, just keep it black. As noted in Microsoft's official guidance, using clear visual cues like this is a cornerstone of building user-friendly and accessible apps.
Enhancing User Experience with Interactive Styling
Conditional formatting isn’t just for showing data states; it's also a game-changer for making your app feel interactive. Two of my favorite techniques are highlighting the selected item and adding hover effects. This kind of immediate visual feedback makes the app feel responsive and intuitive.
Highlighting the Selected Item
To give users a clear signal of what they've clicked on, you can tweak the TemplateFill
property of the gallery itself. This property controls the background color for every row.
A simple and effective formula for the
TemplateFill
property is:If(ThisItem.IsSelected, ColorFade(Color.Blue, 80%), Color.Transparent)
. This logic checks if the current item is the selected one and, if so, fills its background with a light blue. All other rows remain transparent. It’s a small detail that makes a huge difference in usability.
Creating Hover Effects
You can also simulate a hover effect to hint at interactivity as a user mouses over items. While Power Apps doesn't have a built-in "OnHover" trigger for galleries, you can get the same result by setting the HoverFill
property. A subtle color like ColorFade(Color.Gray, 90%)
works perfectly. It provides that gentle visual cue that an item is clickable, which really elevates the user experience.
These little styling adjustments add up to a much more professional interface. They guide the user's focus, provide instant feedback, and make your application feel thoughtfully designed.
To help you get started, I've put together a quick reference table of the Power Fx functions I use all the time for gallery styling.
Essential Power Fx Functions for Gallery Styling
This table is your go-to reference for the functions that will power your dynamic styles and conditional logic. Keep it handy!
Power Fx Function | What It Does for Styling | Common Use Case |
---|---|---|
If() | Applies logic to change properties based on data conditions. | Changing the color of a status label (Color.Red for "Overdue"). |
ColorFade() | Creates a lighter or darker shade of a base color. | Designing subtle hover or selection effects that match your app's theme. |
IsSelected | A boolean property of a gallery item that is true when selected. |
Setting the background fill for the currently selected row. |
ColorValue() | Converts a color name or hex code string into a color value. | Using brand-specific hex codes like ColorValue("#1a3d7d") . |
Mastering these functions will give you precise control over your gallery's look and feel, allowing you to create truly dynamic and user-centric apps.
Frequently Asked Power Apps Gallery Questions
As you start moving past the basics and into building more serious apps, you're bound to hit a few common snags with galleries. This is where theory meets reality. I've pulled together some of the most common questions I get from developers to give you clear, practical solutions that will save you a ton of time and headaches.
Think of this as your go-to troubleshooting guide for getting your galleries to work exactly how you need them to.
How Can I Improve The Performance of A Slow Gallery?
This is the big one. Nine times out of ten, a slow gallery is either a delegation issue or you're simply trying to load way too much data at once. The trick is to make your data source do all the heavy lifting, not your app.
Make sure your Filter()
and Search()
functions are using operations that your data source can handle directly. You should always have Microsoft's official documentation bookmarked to check what’s delegable for SharePoint, Dataverse, or SQL. A single, non-delegable query can bring an otherwise zippy app to a grinding halt.
Another huge culprit? Too many controls inside your gallery template. Every single label, icon, and image you add increases the rendering time for every row.
One of the best things you can do for performance is to enable the 'Explicit column selection' feature. You can find it in your app's settings under 'Upcoming features'. This simple toggle forces Power Apps to only request the data for the columns you're actually using, which can dramatically shrink the amount of data being pulled into the app.
What Is The Difference Between ThisItem and Selected?
This concept trips up almost everyone at first, but it’s actually pretty straightforward once it clicks.
ThisItem
is all about the current row inside the gallery. You'll use it to tell a label or an image what to display for that specific record. For example,ThisItem.Title
orThisItem.CustomerName
.Gallery.Selected
points to the entire record the user has clicked on. You use this outside the gallery to do something with that specific item, like showing more details in a form (Form.Item = Gallery1.Selected
).
In a nutshell: ThisItem
is for displaying data row by row, while Gallery.Selected
is for using the data from the one row the user chose. Getting this right is the key to building those classic master-detail screens.
How Do I Update A Record From A Gallery?
You’ll often want to update a record right from the gallery itself—like ticking off a task or changing a status. This is where the Patch()
function becomes your best friend.
The standard way to do this is to add a button or an icon inside your gallery template. From there, you just need to write a little formula in its OnSelect
property.
The formula almost always looks like this: Patch(YourDataSource, ThisItem, {ColumnToUpdate: NewValue})
.
Let's say you want a button to mark a task as "Completed". The OnSelect
formula would be as simple as Patch(Tasks, ThisItem, {Status: "Completed"})
. When a user clicks that button, it finds that specific record (ThisItem
) in your Tasks
data source and updates the Status
column instantly.
Can I Create A Gallery Inside Another Gallery?
Absolutely. This technique is called a nested gallery, and it's a powerful way to handle parent-child data relationships. Think of a list of clients, where each client row has its own little gallery inside it showing their recent orders.
You just drag a new gallery control and drop it inside the template of your main (parent) gallery.
The real magic is in the Items
property of that new, inner gallery. You need to filter its data based on the current item of the parent. The formula would look something like this: Filter(Orders, ClientID = ThisItem.ID)
. This tells the inner gallery to only show orders that belong to the client in the current row.
A word of caution: while incredibly useful, nested galleries can be heavy. If you have too many nested controls or aren't careful with your data, you can run into performance problems. Use them wisely!
At SamTech 365, we're all about helping you master the entire Power Platform. Check out our other in-depth tutorials and guides to build smarter, more efficient business solutions. Head over to https://www.samtech365.com to keep learning.