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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapps very slow to...
Power Apps
Unanswered

Powerapps very slow to patch to sharepoint list

(2) ShareShare
ReportReport
Posted on by 5

Hi All, 

 

I'm building a timesheet app for my company and facing a delay/latency issue with submitting to sharepoint list. here's how my app is built:

1. I'm pulling a full list of workers names, IDs, etc from a sharepoint list to a collection 

2. using a gallery to  update the collection with regular hours/overtime and presence status for each worker. 

3. a save button with patch command to patch the collection to a sharepoint list. 

 

the problem I'm facing is the app is taking 2-5 min to submit the collection (about 50 lines), and if the user exit the app before it finishes uploading the data, the process will not complete... Please help. thank you 

 

Mo.

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

    Hi @mohaimen88 ,

    Could you please share more details about the formula you used in your app to patch collection to your SP List?

     

    Actually, there are many reasons that an app can be slow to load, slow to respond, and slow to write to data sources. Please check the performace suggestions in the following blog:

    https://baizini-it.com/blog/index.php/2017/09/13/powerapps-improving-app-performance/

     

    If you want to patch a collection back to your SP List, the standard formula as below:

    ForAll(
     Collection1,
     Patch(
     'YourSPList',
     LookUp('YourSPList', ID = Collection1[@ID]),
     {
     Column1: Collection1[@Column1],
     Column2: Collection1[@Column2],
     Column3: Collection1[@Column3],
     ...
     }
     )
    )

     

    In addition, please mak sure the Network on your side is in a good condition and the available RAM is enough on your PC. The Network state and available RAM would also affect the data process in your app.

     

    Please also check if the following performance tips for canvas app would help in your scenario:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/performance-tips

     

    Best regards,

  • Community Power Platform Member Profile Picture
    on at

    Thank you Kris, I tried the threads you sent with no luck. 

     

    here's the formula I'm using: 

    ForAll(ColLabor, Patch(TS_LIST, Defaults(TS_LIST), 
    {
     TS_LABORNAME: L_LaborName,
     TS_LABORNUM: L_LaborNumber,
     TS_PROF: L_Prof,
     TS_PROJECT: L_Project,
     TS_REGHOURS: L_Hours,
     TS_OTHOURS: L_OT,
     TS_HOLIDAYHOURS: L_Holiday,
     TS_REMARKS: L_Remarks,
     TS_DATE: F_Date.SelectedDate,
     TS_CreatedBy: DD_CreatedBy.Selected.Title,
     TS_ABSENT: L_Absent
    })),

     

    Thank you 

    Mo

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
  • pchettri Profile Picture
    39 on at

    any soloution ? even i am facing the same issue, when i patch using 

    ForAll(
    Collection,
    Patch(
    Source,
    Defaults(Source),
    {
    ABC: VarStaffId})) Note: my collection is gallery.allitems 

  • DonPepe Profile Picture
    24 on at

    Same issue on my side.
    I need to update a unique record (single line of 80 columns) and it takes like 5 to 10 minutes to update.
    It's crazy because it's not that much data, it should be instantaneous.

  • DonPepe Profile Picture
    24 on at

    Hi @mohaimen88 try to split your patch in several patch.
    Like from this :

    Patch(YourListSharepoint; LookUp(YourListSharepoint;ID=id); { field_1: ...; field_2: ...; field_3: ...; field_4: ....})
    To this :

    Patch(YourListSharepoint; LookUp(YourListSharepoint;ID=id); { field_1: ...; field_2: ...})

    Patch(YourListSharepoint; LookUp(YourListSharepoint;ID=id); { field_3: ...; field_4: ....})

     

    Don't know why it works better but on my side it's the case.

    Kr,

    Don

  • Suggested answer
    CU07100307-0 Profile Picture
    2 on at
    Patch(
      YourTable,
      ForAll(
         YourCollection As Record,
         {
             column1: Record.collectionColumn1,
             .....
         }
      )
    )
     
    Try this way, it will speed up your problem. But this way don't patch row by row, please check your database before doing your next step.
  • WarrenBelz Profile Picture
    153,042 Most Valuable Professional on at
    This is an old post, but for the record, the reason is that if you use Patch inside a ForAll statement, then PowerApps "loops through" the collection and does an individual Patch for each record in the collection. This is inefficient and can be slow if the collection has a bigger number of records. ForAll() produces a Table, which you can construct and then send to SharePoint in one Patch, which is far more efficient and quicker. 
    Patch(
       TS_LIST,
       ForAll(
          ColLabor As _Data,
          {
             TS_LABORNAME: _Data.L_LaborName,
             TS_LABORNUM: _Data.L_LaborNumber,
             TS_PROF: _Data.L_Prof,
             TS_PROJECT: _Data.L_Project,
             TS_REGHOURS: _Data.L_Hours,
             TS_OTHOURS: _Data.L_OT,
             TS_HOLIDAYHOURS: _Data.L_Holiday,
             TS_REMARKS: _Data.L_Remarks,
             TS_DATE: _F_Date.SelectedDate,
             TS_CreatedBy: DD_CreatedBy.Selected.Title,
             TS_ABSENT: _Data.L_Absent
          }
       )
    )​​​​​​​

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard