Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 3vfo/NAnzsQeG3zRfD5nF9
Power Apps - Building Power Apps
Unanswered

Saving Collection SharePoint Speed issue

Like (1) ShareShare
ReportReport
Posted on 8 Jan 2020 08:45:30 by 2

Hi,

 

I built a staff appraisal app the saves from a collection to a SharePoint list, around 60 lines per user, the app collects the entries on start then the user can make changes to previously submitted ratings or add new ones.

 

the save button will patch all 60 lines from the collection back to SP but is currently very slow, I was wondering if anyone knows if there is a way to customize the code below to save faster.

 

Set(LoadingSpinnerVisibility,true);
ForAll(RenameColumns(CollectionUserGrids, "ID", "CID","SelfAppraisal", "CSelfAppraisal", "FinalResponses", "CFinalResponses","IsTarget", "CIsTarget"), Patch('Appraisal Data Details', LookUp('Appraisal Data Details', ID = CID), {SelfAppraisal: CSelfAppraisal}, {FinalResponses: CFinalResponses},{IsTarget: CIsTarget}));
Set(LoadingSpinnerVisibility,false)

 

Many thanks in advance.

Nelly

 

Categories:
  • v-siky-msft Profile Picture
    on 09 Jan 2020 at 07:02:35
    Re: Saving Collection SharePoint Speed issue

    Hi @NGamil ,

     

    It's hard to optimize the ForAll function itself, but we can get goal in roundabout way.

    As @poweractivate said, try to use flow to save collection data to SP list in bulk, the flow just runs in the backend more efficiently.

     

    1. convert collection to JSON in PowerApps

    Set(VarJson,JSON(MyCollection,JSONFormat.IncludeBinaryData))

    2. parse json in flow

    3. apply to each row, and create the items to Sharepoint list.

    Snipaste_2020-01-09_15-01-18.png

    Sik

  • poweractivate Profile Picture
    11,078 Most Valuable Professional on 08 Jan 2020 at 08:57:22
    Re: Saving Collection SharePoint Speed issue

    @NGamil 

     

    1.  If appropriate for your use case, you can attempt to use Power Automate (Flow) and make it happen in the background by triggering the Flow from the PowerApps Canvas App and have the processing be done in the background asynchronously in Power Automate (Flow).
    2.  If it has to be done in PowerApps, you can try and use a Timer to process each element one by one with each element being patched individually, with a delay in between and the Timer repeating and an index incrementing each timer tick until all the elements were patched one by one, although depending on your use case, it may just be better what you are doing now. For some use cases, this suggestion could work though, depending what it is.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

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,645 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,997 Most Valuable Professional

Leaderboard
Loading started
Loading complete