cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver I
Resolver I

Sharepoint/Powerapps calculations

I have a Sharepoint list that records petty cash transactions. I have a calculated colum (BalanceSum) which works fine as long as there is an amount in StartBalance. 

Is there a way in Sharepoint or in the associated powerapp to poulate the 'StartBalance' column of the next line with the previous line's 'BalanceSum' amount?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @KevinHardy ,

Do you want to update all the records at the same time (update 'StartBalance' with previous line's 'BalanceSum')?

I suggest you try ForAll and Update function.

Try this formula:

ClearCollect(collection1,AddColumns(listname,"Id2",Id+1));
ForAll(collection1,Patch(listname,Lookup(listname,Id=Id2),{StartBalance:BalanceSum})

Here's a doc about how to update multiple records for your reference:

https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch/

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Hi @KevinHardy ,

Do you want to update all the records at the same time (update 'StartBalance' with previous line's 'BalanceSum')?

I suggest you try ForAll and Update function.

Try this formula:

ClearCollect(collection1,AddColumns(listname,"Id2",Id+1));
ForAll(collection1,Patch(listname,Lookup(listname,Id=Id2),{StartBalance:BalanceSum})

Here's a doc about how to update multiple records for your reference:

https://powerapps.microsoft.com/en-us/blog/bulk-update-using-forall-and-patch/

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,015)