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

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 @Hidayat ,

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."


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 @Hidayat ,

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

 

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 III
Super User III

@Hidayat 

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 @Hidayat ,

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

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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,923)