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

Save Data in SharePoint List from multiple galleries

(0) ShareShare
ReportReport
Posted on by 271

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
    153,034 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

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