Canvas Apps Controls

Galleries vs Data Tables – How to pick between the two in Power Apps?

List of records - gallery or data table?
List of records - gallery or data table?

Introduction

There are two options for displaying a list of records - galleries and data tables. Their definitions per Microsoft Docs are:

  1. A gallery is a control that contains other controls and shows a set of data.
  2. A data table shows a set of data in a tabular format.

Which one should you use for your apps? The answer, for a change, is it depends. In the next section, I will list the advantages of both and when it makes sense to use one vs the other.

Tip - Pros & Cons of galleries

Pros: 

  1. As the definition above states, it can have other controls inside
  2. It can be used to list, edit, and create new records
  3. You have the option to arrange data for each row horizontally (from left to right) or vertically (from top to bottom)
  4. There are 2 options - horizontal (with a horizontal scroll bar) and vertical (with a vertical scroll bar) galleries
  5. Flexible height galleries allow for row heights to adjust based on the row data
  6. A vertical gallery can have more than 1 column and a horizontal gallery can have more than 1 row. This can be achieved using the WrapCount property
  7. The default selected record can be specified using the Default property
  8. The default property helps in auto scrolling a gallery (detailed blog here)
  9. You can add a loading spinner just like how you can add one to a screen

Cons:

  1. There are no headers to designate what each control within a row is for. For this, you need to add labels/buttons outside the gallery
  2. For a vertical gallery, there is no horizontal scroll bar if the data cannot fit within the width of the screen
  3. There is no default text that gets displayed when there is no data within a gallery

Tip - Pros & Cons of data tables

Pros: 

  1. It comes with headers that can be formatted without adding additional controls like buttons/labels
  2. The NoDataText property specifies what data to display when there is no data
  3. It provides a horizontal scroll bar if the data cannot fit within the width of the screen
  4. The AutoWidth property of a column allows for column widths to adjust based on the data

Cons: 

  1. There is no horizontal data table
  2. You cannot add controls to a data table
  3. It cannot be used to edit or create new records
  4. There is no Default property to specify the default selected record

Thus, based on your use case, choose the one that makes the most sense. That being said, personally, I have always found galleries to be more versatile than tables! But, I don't want to bias you (am sorry if I already have!)

Stay tuned for the remaining 19 tips!

Recent articles

  1. A-Z: 26 tips! Learn how to improve your Power Apps!
  2. Add Picture vs Camera Control – Who is the winner?
  3. Background images for Power Apps screens – the right way!
  4. Combo box or Dropdown? - Who is the winner?
  5. Delegation in Power Apps – How to identify and test!
  6. Edit vs Display – Which is the better form?
  7. Formulas – How to learn the 170+ Power Apps formulas?

9 thoughts on “Galleries vs Data Tables – How to pick between the two in Power Apps?”

  1. Since I’m starting to develop a schedule app at my job I find more useful how rich the galleries are, because we manage more than 10 schedules and having more than 10 DataTables inflicts a lot in the app performance.

Leave a Reply