cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PriyaShetty
Helper I
Helper I

ADD record to a table of another table in powerapps

Can anyone help me on how can I add few field records of one table to another in powerapps?.

I am updating a table "A" with data using gallery .Now I want to add some field records to another table "B" from table "A"

2 ACCEPTED SOLUTIONS

Accepted Solutions
timl
Super User
Super User

Hi @PriyaShetty 

The way to do this is to call the Patch function to add your records to Table B.

@eka24's  code here gives a good example.

https://powerusers.microsoft.com/t5/Building-Power-Apps/Need-to-copy-records-from-one-table-to-anoth... 

Here's a link to online documentation for Patch.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-patch 

View solution in original post

Hi @PriyaShetty 

You're welcome!

You can use the GroupBy and Sum functions to do this.

Here's the help page.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-groupby 

Your formula would approximately look like this. This will return a table with the columns Pid and SumOfRating.

AddColumns( 
 GroupBy(TableA, "Pid", "GroupedItems"),
 "SumOfRating",
 Sum(GroupedItems, Rating)
)

 

View solution in original post

3 REPLIES 3
timl
Super User
Super User

Hi @PriyaShetty 

The way to do this is to call the Patch function to add your records to Table B.

@eka24's  code here gives a good example.

https://powerusers.microsoft.com/t5/Building-Power-Apps/Need-to-copy-records-from-one-table-to-anoth... 

Here's a link to online documentation for Patch.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-patch 

View solution in original post

@timl Thank You.This solution worked  for me.As I have one more query on how can sum all the field values .

Below is the table

Pid      Rating

201      2

201      3

201      1

301      2 

301      1

 

 

so i should get sum of rating for all pid 201 as 6 and for 301 as 3

Hi @PriyaShetty 

You're welcome!

You can use the GroupBy and Sum functions to do this.

Here's the help page.

https://docs.microsoft.com/en-gb/powerapps/maker/canvas-apps/functions/function-groupby 

Your formula would approximately look like this. This will return a table with the columns Pid and SumOfRating.

AddColumns( 
 GroupBy(TableA, "Pid", "GroupedItems"),
 "SumOfRating",
 Sum(GroupedItems, Rating)
)

 

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (3,199)