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 / Save Data in SharePoin...
Power Apps
Unanswered

Save Data in SharePoint List from multiple galleries

(0) ShareShare
ReportReport
Posted on by 273

Hi,

Below is the formula for storing data from two galleries into a SharePoint list.

 

Sam70_0-1718719757848.png

Problem is that time taken to store 37 rows of data is more than a minute. Unable to figure out the cause and need your help.

 

Regards

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,930 Most Valuable Professional on at

    Hi @Sam70 ,

    It is because ForAll() is not designed to be a Loop, although it can work this way with considerable performance penalty as it does an individual Patch for each record. ForAll() creates a Table, which can be patched in one action provided its content is correct. For new records, this is simply a Table with field names and field types matching the list. Also can you please remember to post your code in Text as it saves re-typing here. This code is OCR'd, so please watch spelling. I am also assuming here all the controls are in the Gallery - if not remove the _Data reference.

    Patch(
     'Skill Data 2',
     ForAll(
     GalleryOverall.AllItems As _Data,
     {
     Title: _Data.OveAllLabel.Text,
     'Skill Type': {Value: _Data.Label39.Text},
     Scores: _Data.OvrAllComboBox.Selected.Value,
     'User S':
     {
     Claims: "i:0#.f|membership|" & Lower(User().Email), 
     Department: "",
     DisplayName: User().FullName,
     Email: User().Email,
     JobTitle: "",
     Picture: ""
     },
     'Date S': Today()
     }
     )
    );
    Patch(
     'Skill Data 2',
     ForAll(
     GalleryDiagnostic.AllItems As _Data,
     {
     Title: _Data.DiagLabel.Text,
     'Skill Type': {Value: _Data.Label46.Text}, 
     Scores : _Data.DiagComboBox.Selected.Value,
     'User S': 
     {
     Claims: "i:0#.f|membership|" & Lower(User().Email),
     Department : "",
     DisplayName: User().FullName, 
     Email: User().Email,
     JobTitle: "",
     Picture: ""
     },
     'Date S': Today()
     }
     )
    );

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

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
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard