Not all data lives in data sources and, once in a while; it’s useful to generate a table of objects that lives in your App. Examples can be fill-in in dropdowns, have configuration data that only lives during your session, or have a way to refer back the changes that you made by keeping the values in a table.

One thing to keep in mind. A table can have multiple columns, and they are generated based on the union of all rows. For example, you can have one with names, addresses, and employee numbers so that the table will have 3 columns. If you don’t have a value in a row, the column will be created anyway if any row contains a value.

Usage

It follows a simple pattern.

  1. Element(s)

Example:

Table({Color:"red"}, {Color:"green"}, {Color:"blue"})

Color
red
green
blue

If you don’t want to use the Table Function, note that you can generate the values as follows:

["red","green","blue"]

The same rules apply to this notation using a Table function, but this will always create a single-column table.

Let’s check what happens when we don’t provide a value.

Table({Name:"Manuel", City:"Lisbon"}, {Name:"Jack"}, {Name:"John"})

Name  City
Manuel Lisbon
Jack 
John

As we mentioned before, the columns will be generated even if just one element has values.

Limitations

This won’t create a permanent table automatically, so if you want to store it, you need to store the data.

Recommendations:

  1. Use only for temporary actions or to keep data during the session. Anything else should be organized in its corresponding data source.
  2. You can use functions to add values. For example, you can have a column “Name” and the other the “Len” of the name.
  3. Save the table in a variable. It will be easier to move the values around your Power App.
  4. Don’t nest it. There’s no real reason to do it, but if you find yourself in a situation where you have nested Count functions in a formula, you should review it because something’s not right.
Please note that formulas may have localization-based differences. For example, you should write “Table” with “,” separating each of the arguments, but if your regional settings are set to Portugal you should use “ ;” instead.

Sources:

Working with tables in Power Apps

Back to the Power Apps Function Reference

Photo by NMG Network on Unsplash

Manuel Gomes

I have 18 years of experience in automation, project management, and development. In addition to that, I have been writing for this website for over 3 years now, providing readers with valuable insights and information. I hope my expertise allows me to create compelling, informative content that resonates with the audience.

View all posts by Manuel Gomes →

Leave a Reply

Your email address will not be published. Required fields are marked *