web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch->ClearCollect->t...
Power Apps
Unanswered

Patch->ClearCollect->timer needed?

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello all,

I'm working on a Time and Expense forcasting app - users enter upcoming expenses into it before they spend the $ and get approval if they exceed a certain $.

In my app (using sharepoint list datasource), the user enterings data via an editform which i'm storing into a collection.  When they're done and submit, I'm doing a ForAll to patch allitems of the gallery displaying the collection to a Sharepoint list.  On the same screen that they're entering data into the form, there's a second gallery that displays their existing entries.  The newly submitted entries get added to the datasource, and they populate into the second gallery once submitted.  There's labels that show a total of the expenses. If the total of items in the first collection plus the total of the items in the existing collection are > $2000, I'm populating an html control to send to Flow for approval. 

When forall patches to the datasource, the existing expenses gallery wasn't always showing newly added items that just got submitted, and sometimes the gallery would show the data but the labels showing the totals weren't updating to include the newly added entries.  I started realizing it was a timing issue with everything happening too quickly, so I started adding timers to 1) refresh the datasource, 2) clearcollect the datasource for the second gallery's items and 3) re-total up the totals.  Now i've got a timer which, on timer end starts another timer which starts another and think i've gone overboard on the timers Smiley Indifferent.  I also found the timing issue wasn't happening if I previewed the app, but if I loaded it normally outside of the previewer, it was happening more often.  

Now that i'm in timer overload, if I don't make one timer's duration long enough, the next timer won't even start.  Some of the timers, I've left the OnTimerStart to false, and just do the work OnTimerEnd.

Are all of these timers necessary to accomplish my goal and how do I get out of this timer madness! 😞

Thx in advance

Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @russrimm ,

    Based on your description, I think the mainly problem is that your data updates frequently.

    I suggest you turn this setting on:
    File->app settings1043.PNG

    Trurning this on will lead to refreshing data slowlier.

    If you want to display sum results more accuratly, you could add refresh function.

    For example:

    Refresh(data source);Sum(...)....

     

     

    Best regards,

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 762

#2
11manish Profile Picture

11manish 640

#3
Valantis Profile Picture

Valantis 548

Last 30 days Overall leaderboard