Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Save button - collections update/refresh

Like (0) ShareShare
ReportReport
Posted on 6 Sep 2021 05:16:24 by 235

Hi everyone, I am having a hard time figuring this one out. So I have a save button that saves the collection onto my SP lists. I have another button that generates the collection - new row button. As you can see on the client total (bottom) was incorrect as the collections update only when I hit the new row button.  How can I refresh the collections before saving them to my sp list in order to have the right amount? Thanks in advance.

 

rbalza_0-1630905204169.png

Here's new row button code

Collect(
 GalleryPricingData,
 {
 Job_x0020_Category: JobCategory.Selected.Result,
 Entity_x0020_Type: EntityType.Selected.Result,
 Job_x0020_Type: JobType.Selected.Result,
 Invoice_x0020_Description: InvoiceDescription.Value,
 Min_x0020_Fee: MinFee.Value,
 Qty: Quantity.Value,
 Nominal_x0020_Value: NominalValue.Value,
 Complexity_x0020_Value: ComplexityValue.Value,
 Total: Total.Value,
 Client_x0020_Name: ClientName.Selected.Result,
 ClientGroup: ClientGroup.Value,
 ClientCode: ClientCode.Value
 }
)

Save button code

 Collect(
 'Saved Data-18162676-8464-4e9f-ae16-3c8b172e614d',
 GalleryPricingData
 );
 Clear(GalleryPricingData);
 Reset(ClientName);
 Reset(ClientGroup);
 Reset(ClientCode);
 Notify(
 "Record has been succesfully saved",
 Success,
 2000
 );
  • Verified answer
    v-bofeng-msft Profile Picture
    on 10 Sep 2021 at 01:53:52
    Re: Save button - collections update/refresh

    Hi @rbalza :

    This thread seem the same like this one:

    Solved: Re: Saving updated gallery (collections) / Auto-re... - Page 3 - Power Platform Community (microsoft.com)

    If this problem is resolved,please consider marking this reply as a 'solution' to help others.

    If you still have any questions, please let me know.

    Best Regards,
    Bof

  • Community Power Platform Member Profile Picture
    on 06 Sep 2021 at 15:01:12
    Re: Save button - collections update/refresh

    Hello @rbalza 

    you can use the below steps to overcome your issue 

     

    1) Apply the same Patch/Update to the collection that you are applying to the data source.

    2) Re-run whatever code you ran to create the collection, to begin with.  Make sure to use a Clear() or ClearCollect as the first statement or you'll get duplicates.

     

    Thank You

  • WarrenBelz Profile Picture
    146,668 Most Valuable Professional on 06 Sep 2021 at 06:31:38
    Re: Save button - collections update/refresh

    Hi @rbalza ,

    You have not included the formula on the total control

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started