Power Apps Update Data Table [With Examples]

When working with the Power Apps data table, sometimes we need to update the data table columns according to our needs. In this Power Apps tutorial, I will discuss how to update the data table columns or fields in Power Apps.

Additionally, we will also cover the below topics. Such as:

  • Power Apps refresh data table
  • Power Apps update collection column value

Power Apps Update Data Table Columns

Here, I will show you how to update Power Apps data table columns using different examples. Such as:

Example-1:

I have a SharePoint Online list named “Product Details” and this list contains the below fields.

Column NameData Type
Product NameIt is a default single line of text
ManufacturerChoice
PriceCurrency
QuantityNumber
Purchase DateDate and time
datatable powerapps

In Power Apps, there is a Data table having the SharePoint list records. Whenever you connect the SharePoint list to the data table, the data table displays the default title column name [Product Name] as “Title.”

powerapps update table

However, if you want to display the Title column name as “Product Name,” you can change the Header Text to Product Name under the Properties pane, as shown below.

Power Apps datatable update data

Example-2:

In this example, I will show you how to display the Price column value after adding a 20% discount. To do so, select the Price_Column1 and set its Text property to the code below.

Text = ThisItem.Price*20/100                                     //You can change the discount value

Where,

  • 20/100 = It is the value of the discount for the Price value
datatable in powerapps

Example-3:

See also  How to create and use dataflow in Dataverse

Suppose you want to combine and display the two column values [Product Name and Manufacturer] in one column [Product Name and Manufacturer]. To achieve it, follow the below code.

Text = ThisItem.Title & "/" & ThisItem.Manufacturer.Value

This is how we can work with the Power Apps data table columns.

datatable update data in powerapps

Power Apps Refresh Data Table

Whenever you can use the Clear or Reset functions to refresh the Power Apps data table, you will get an error message [The function ‘Clear’ has some invalid arguments. Invalid argument type (Control). Expecting a Table value instead. The first argument of ‘Clear’ should be a collection.]

powerapps refresh data table

To resolve this issue, you can use the Power Apps collection. For that, select the App object and set its OnStart property to the code below.

OnStart = ClearCollect(colProducts,'Product Details')

Where,

  • colProducts = Power APps collection name
  • ‘Product Details’ = SharePoint Online list
power apps refresh data table

Now, select the Data table control and set its Items property as:

DataSource = colProducts
power apps update data table

Finally, insert a Reset icon and set its OnSelect property to the code below.

OnSelect = Clear(colProducts)

Once your app is ready, save, publish, and Preview the app. When the user clicks on the reset icon, it will reset the data table in Power Apps.

Have a look at the below screenshot for the output.

refresh data table in powerapps

Power Apps update collection column value

Finally, I will show you how to update the Power Apps collection column value in the data table using a simple scenario.

Scenario:

I will also use the above Power Apps collection [colProducts] for this example. Now, I would like to display the whole amount [Price*Quantity] in the Price column using the code below.

Text = ThisItem.Price*ThisItem.Quantity

This is how we can work with the Power Apps update collection column value in the data table.

powerapps update collection column value

I hope this Power Apps tutorial is helpful for you; in this tutorial, we learned how to update the Power Apps data table columns using simple examples and discussed how to refresh the data table in Power Apps.

See also  8 Various Ways to Use The Patch Function in Power Apps

In the last, we covered Power Apps update collection column value using the data table.

Also, you may like:

>