Power Apps Summary of Data Tables for displaying data in tabular format|Discussion on how to use with the Gallery.

In Power Apps, there are two types of controls for displaying a list of data: “Gallery” and “Data Table”.

I have always used “Gallery” only, but this time I had a chance to use “Data Table”, so I will write down how to use it and how it differs from Gallery.

スポンサーリンク

Data Table

The Data Table control is a control that can display data in a table format like Excel.

For example, this is how it appears when user data from the O365 connector is tied together.
For more details, please see the formula, but I think these are the main features of the data table.

  • Single selection (multiple selections are not allowed)
  • Column width changeable (not saved)
  • Hyperlinks can be displayed and transitions made with a click
  • It automatically gives you a header.
  • Scroll bars appear in two directions (vertical and horizontal)

Basic Usage

It is very easy to use. Bring up the data table.
Let the Items property contain the data.
Then, simply select the data you want to display from “Edit Fields” and the data will be displayed in a tabular format.
Convenient!
Of course, you can also display SharePoint lists and such like this list in SharePoint.
When tied together using the SharePoint connector, it appears like this.

Data selection is also possible

The DataTable holds the data selection state, so give them a form with the same DataSource next to it,
By associating the Item property of the form with the Selected property of the data table, it is possible to display the selected data on the form.

Use with the “Gallery”

Similarly, there is a “gallery” control that lists data.

Which of these two would you use? When considering which of the two to use, I believe the following should be taken into account.

  • No detailed UI settings, large amount of information to display: data tables
  • Detailed UI settings, but not too much information to display: Gallery

The following is a slightly more detailed look at the differences between the two.

Scrollbar display differences

First, here is how the scrollbar display differs.

  • Gallery: Vertical or Horizontal
  • Data tables: vertical and horizontal
The following images show a gallery with the data in a data table at the top and in tabular form at the bottom, with the differences in the scroll bars clearly visible.

Data table looks good when displaying data with a lot of information both horizontally and vertically.

Fine-tuning of appearance

The fine-tuning of the look and feel is by far the better part of the gallery.

Images and buttons can be added like this, and OnSelect can be specified for each control.

If you want to display the listed data with some degree of aesthetics, a gallery would be better.

Add Column -> Data Table can’t use LookUp?

For example, I have a master like this in a SharePoint list or something,

I want to add a column to the Power Apps screen and display the employee number as well! When it comes to,

The gallery could simply use LookUp to pull the data,
The same LookUp expression can be used in a data table, but it causes a glitch.
So, it is necessary to tweak the data itself to be put into Items with AddColumns.

If you want to do some processing for each listed data, the gallery is more flexible.

Data table does not allow external access to Items

It seems that the data table does not allow access to the listed data from the outside.

For example, if you want to count the number of data in a list, you can use the AllItems property in the gallery,

Loop processing can also be realized by combining the ForAll function and the AllItems property, but the data table does not have a property that corresponds to this AllItems property.

So, if we want to count the number of data in the DataTable, we need to count the same data as we put in Items of the DataTable.

This would affect performance because it throws (I think it throws) REST twice.

Conclusion

Therefore, as mentioned at the beginning of this section, when considering the use of Gallery and Data Table, it is recommended to consider the following

Data Table” when handling data with a large amount of information to be displayed without detailed UI settings and without access to each data,

If you want detailed UI settings or access to each data, or if you handle data with a small amount of information to be displayed, use “Gallery”,

It’s just a feeling, but I think the display speed is faster with the data table.

Related Articles

コメント

タイトルとURLをコピーしました