cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Sum in Gallery once Patch is done

Hi all,

Is there a way to show an updated sum of values once patch is done?

Initially, my Gallery1 has an item A quantity is 1.

When a customer placed an order, the data is patch to the SPO list and creates a new record with Item A quantity -1.

The SUM in SPO of item A is 0. 

But in gallery1, the quantity is still 1.

 

Below is the label, text input:

"Available Quantity: " & Text(Sum(ThisItem.'AvailableQuantity'))
 
I'm not sure if this needs a statement to refresh gallery or screen.
Thanks for the help in advance!
 
 
Regards
Hidayat
1 ACCEPTED SOLUTION

Accepted Solutions

ok so you want to view the item and the total in the gallery.

 

you will have to add a column and .. addcolumns(GroupBy(yourSharePointList,"ColumnToGroup","Balance"),"AggregateIt",Sum(Balance,ValueColumn))

 

add a label in the gallery and set the text to thisitem.AggregateIt

 

hope it helps

View solution in original post

14 REPLIES 14
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Anonymous ,

You can use the below code below the patch code. on Button OnSelect properties.

Refresh(Listname);

Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."


Anonymous
Not applicable

Hi @VijayTailor ,

 

Added the refresh to the patch function.

The item A still has quantity of 1 in gallery.

 

Regards

Hidayat

rubin_boer
Super User
Super User

hi there have you tried refreshing the data, Refresh(yourdatasource). patch is only updating the SP list, the data in your gallery is the same unless you refresh it.

Hi @Anonymous ,

In that Scenario,

if you are using the Collection for Gallery then you also need to Update the Collection.

Thanks.

hi there

 

please check this

sum_value.PNG

 

Anonymous
Not applicable

Hi @rubin_boer ,

Not intending to use another label outside the gallery.

The label has to be in the gallery.

 

Hi @VijayTailor ,

The gallery is picking the data source directly from SPO list.

 

Regards

Hidayat

RandyHayes
Super User
Super User

@Anonymous 

If you are just displaying the AvailableQuantity, can you explain more about where Sum comes into this?

 

Your formula for the label should be:

"Available Quantity: " & ThisItem.'AvailableQuantity'

If you are truly connected to the SharePoint list in your Items property, there is NO need to refresh after a Patch or Update.  The Gallery as well does not need to be Refreshed.

 

But, I am curious about your use of Sum in your original formula.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hi @Anonymous ,

As i tried, working perfectly fine for my side

Please have a look into the below-mentioned URL for see  the Test Demo.
https://drive.google.com/file/d/1HIDJ15c6MFs4VaNupetHdzOUCq5moaPw/view.

Thanks

Anonymous
Not applicable

Hi @RandyHayes ,

 

Removed the SUM in the text label within the gallery, the quantity still gives me 1 in the text label.

 

Regards

Hidayat

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,622)