Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Issue: Power Apps Patch Function Not Saving Data from Collection

(1) ShareShare
ReportReport
Posted on by 6

 

I have an app in Power Apps that registers contract information with suppliers and stores it in an Excel sheet. The app includes a screen where the user can specify the number of suppliers (via an input box), and fields for each supplier are automatically generated.

I’m using the ClearCollect function to gather supplier information into a collection (LeverandorCollection), and then a ForAll function to iterate through the collection and save the data to an Excel table. However, while the form data is saved correctly, the data from the collection (supplier-specific information) is not being transferred or saved to the Excel sheet.

Here's the Patch function I'm currently using:

 
ForAll(
LeverandorCollection;
Patch(
Tabell2;
Defaults(Tabell2);
{
Leverandør: ThisRecord.LeverandorNavn;
'17 Organisasjonsummer': ThisRecord.OrgNummer;
'19 Kontaktperson leverandør (navn)': ThisRecord.KontaktNavn;
'20 Kontaktperson leverandør (epost)': ThisRecord.KontaktEpost;
'21 Fakturamerking/referanse': ThisRecord.FakturaReferanse
};
RegistrerFlereLeverandører.Updates
)
)

Despite this, only the form data is saved, and none of the supplier data from the collection gets through. What might be causing this, and how can I ensure the supplier data is saved correctly?

  • WarrenBelz Profile Picture
    148,728 Most Valuable Professional on at
    Issue: Power Apps Patch Function Not Saving Data from Collection
    I will add a comment here as there is nothing fundamentally wrong with the code assuming those field names are valid. You can try this alternative
    ForAll(
       LeverandorCollection As _Data;
       Patch(
          Tabell2;
          Defaults(Tabell2);
          {
             Leverandør: _Data.LeverandorNavn;
             '17 Organisasjonsummer': _Data.OrgNummer;
             '19 Kontaktperson leverandør (navn)': _Data.KontaktNavn;
             '20 Kontaktperson leverandør (epost)': _Data.KontaktEpost;
             '21 Fakturamerking/referanse': _Data.FakturaReferanse
          },
          RegistrerFlereLeverandører.Updates
       )
    )
    but I think your underlying issue may be Excel itself, which is a terrible data source and really one of "last resort". Do you have access to SharePoint ? If so, create this in a List and your issues should go away.
  • scalca Profile Picture
    243 Super User 2025 Season 1 on at
    Issue: Power Apps Patch Function Not Saving Data from Collection
    do you get any error message ? 
    can you confirm connection to excel online sheet is working ? 
    can you check if you get any information from the excel sheet into the app just to be sure you are connected to the excel sheet ? 
  • SS-02100810-0 Profile Picture
    6 on at
    Issue: Power Apps Patch Function Not Saving Data from Collection
    Hi, and thank you for your solution attempt. 

    When removing the .Updates part, nothing transfers to the excel table. When included atleast information from the form RegistrerFlereLeverandører gets transfered and stored. 

    A bit tricky this one. 

    Best regards,
    Simen

     
  • Nandit Profile Picture
    1,563 Super User 2025 Season 1 on at
    Issue: Power Apps Patch Function Not Saving Data from Collection
     
    I don't think you need the RegistrerFlereLeverandører.Updates part in your code. 
    You just need the following to make it work:
    ForAll(
    LeverandorCollection;
    Patch(
    Tabell2;
    Defaults(Tabell2);
    {
    Leverandør: ThisRecord.LeverandorNavn;
    '17 Organisasjonsummer': ThisRecord.OrgNummer;
    '19 Kontaktperson leverandør (navn)': ThisRecord.KontaktNavn;
    '20 Kontaktperson leverandør (epost)': ThisRecord.KontaktEpost;
    '21 Fakturamerking/referanse': ThisRecord.FakturaReferanse
    }))
     
    Hope this helps. 
     
    Kind regards, 
    Nandit
     
    If this answers your query, please mark this response as the answer.
    If its helpful, please leave a like. Thanks!
     

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 1