Power Apps Collection vs Table [With Examples]

Power Apps is a low-code solution where we can work with data by creating a Power Apps app. In this Power Apps tutorial, I will explain everything about Power Apps Collection vs Table.

Additionally, I will show you what is Power Apps table is and how to create a table using the Table function in Power Apps.

The difference between the Power Apps collection and the table is that “when creating a collection, we used to provide our collection name after using the collect function.” That name can be used anywhere on the Power Apps screens.

But in the table, we use only the table function to create a table in Power Apps.

Power Apps Collection vs Table

I will show you the differences between the Power Apps collection and table.

Power Apps Collection

  • By collection, we can store the data and create a collection by providing the collection name, which is temporary data storage and can be used anywhere on the Power Apps screens.
  • Using the Power Apps Collection function, we can create new collections with different columns and their values or any data source.

Power Apps Collection Syntax:

Collect(CollectionName, {values});
  • In the collection, we cannot directly provide the collect function in any galley control or data table to store the data. Else, if we try to do this, we will find an error in the collect function code as shown below:
What are differences between Power Apps collection and table
  • So, we can add any button control or use the OnStart property to create a collection in Power Apps. We can provide the collection name in the gallery control or Data table to display that data.
What differences between the Power Apps collection and table
  • We can join two or more tables based on common columns using the join function.
  • We can sort or filter the data from an existing collection based on the columns.

Power Apps Table

  • A table is a data group; we can create it by defining the columns and their values.
  • Using the table function, we can join two or more tables based on common columns.

Power Apps Table Syntax:

Table({values});
  • Here, we can manage or organize the data in the Power Apps app.
  • In the collection, I have explained we cannot directly provide the collect function in any galley control or data table to store the data.
  • But here, In the Power Apps table, we can directly provide the table function in any gallery control or data table to store and display the data as shown below:
Power Apps canvas app collection vs table

Collection vs Table using Power Apps

  • We can sort or filter the data from an existing collection based on the columns.
  • Can group the data from an existing collection based on the columns.

Create a Table Within the Power Apps App

I will show you how to create a table within the Power Apps app.

  • Create the new Power Apps blank canvas app, insert the text label as a header, and provide the text based on the requirement.
  • On the Power Apps screen, we will insert the Data table as shown below:
Power Apps collection vs table
  • Click on the data table, select the Items property, and then provide the code as:
Items: Table({Furniture: "Nest Sofa", 'Arriving Date': "08/09/2023"},{Furniture: "Dining Table", 'Arriving Date': "11/09/2023"},{Furniture: "Table glass", 'Arriving Date': "22/09/2023"},{Furniture: "Refrigerator", 'Arriving Date': "15/09/2023"},{Furniture: "Sony Washing Machine", 'Arriving Date': "18/09/2023"},{Furniture: "Videocon Television", 'Arriving Date': "28/09/2023"},{Furniture: "Sofa Chair", 'Arriving Date': "06/09/2023"},{Furniture: "Cupboard", 'Arriving Date': "27/09/2023"},{Furniture: "Mirror Cupboard", 'Arriving Date': "19/09/2023"})

Where,

  • Table = Table function
  • Furniture, Arriving Date = They are the names of the columns.
Power Apps canvas app collection vs table
  • After creating a table, still, there are no fields in the data table as shown below:
Difference between Power Apps collection and table
  • To display the Power Apps fields, on the data table properties pane [Right-hand side] -> Select the Edit fields -> Click on the Add field -> Select the fields -> Then click on the Add button.
Difference between Power Apps canvas ap collection and table
  • Now, we can see that the data table is created from a Table function, as shown below:
Collection vs Table using Power Apps

This is how to create a table function using the Power Apps app.

Create a Collection Within the Power Apps App

Here, I will show you how to create a collection manually in the Power Apps app

  • Create the new Power Apps blank canvas app, insert the text label as a header, and provide the text based on the requirement.
  • Here, I will add the button control to create a collect function, as shown below:
Difference between the Power Apps collection and table
  • On the button OnSelect property, we will provide the code to create a collection.
Collect(colProduct,{ProductName:"Laptop",ProductPrice:"$600"},{'Product Name':"Mouse",'Product Price':"$300"},{'Product Name':"Laptop Charger",'Product Price':"$170"},{'Product Name':"Speakers",'Product Price':"$250"},{'Product Name':"Keyboard",'Product Price':"$200"},{'Product Name':"Laptop Bluetooth",'Product Price':"$170"},{'Product Name':"Lenovo Laptop",'Product Price':"$650"},{'Product Name':"Laptop Charger",'Product Price':"$370"})
Difference between Power Apps canvas app collection vs table
  • On the Power Apps screen, we will insert the Vertical gallery control to display the data as shown below:
What are differences between the Power Apps collection and table
  • Click on the gallery control, select the Items property, and then provide the code as:
Items: colProduct
What differences between Power Apps collection and table
  • Now, we, the user, play or run the app.
  • Click on the button control, and it displays the data that we have created collection manually, as shown below:
What differences between the Power Apps collection and table

This is how to create a Power Apps collection.

Also, you may like some more Power Apps tutorials:

Conclusion

I have shown you the differences between the Power Apps collection and a Power Apps table. We cannot directly provide the collect function in any galley control or data table to store the data, but we can do so in the table function, which will store and display the data.

Also, I have covered how to create a table within the Power Apps app and discussed how to create a collection within the Power Apps app.