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 / EditForm upload attach...
Power Apps
Unanswered

EditForm upload attachments to document library

(0) ShareShare
ReportReport
Posted on by 603

I have a powerapp newform with SharePoint as the datasource. User can upload documents in NewForm which gets stored in document library successfully. Below is the code for the same.

 

NewForm Submit Button

 

Iantaylor2050_0-1700674220826.png

 

ForAll(
 DataCardValue11.Attachments As file,
 'UAT-UploadtoDocLib'.Run(
 {
 contentBytes: file.Value,
 name: file.Name
 },
 DataCardValue3.Text,
 DataCardValue15.Text
 )
 );

 

I tried the same in EditForm, where user can upload additional documents. Sample2 and Sample3 are the new docs attached in EditForm. 

 

Iantaylor2050_1-1700674485876.png

 

EditForm Submit Button

ForAll(
 DataCardValue11_2.Attachments As file1,
 'UAT-UploadtoDocLib'.Run(
 {
 contentBytes: file1.Value,
 name: file1.Name
 },
 DataCardValue3_2.Text,
 DataCardValue16.Text
 )
 );

 

Sample2 an Sample3 gets uploaded in document library, however it takes lot of time. I need to wait for 2 minutes for the form to be submitted. Documents are very minimal in size as well not even 1 MB. Also, i face below error once flow ran.

 

Iantaylor2050_2-1700674754768.png

May i know how to avoid this? There is no network issue or internet connection as highlighted in above error. It happens for all users.

 

 

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

    Hi @Iantaylor2050 ,

    Can you please share your Flow here, particularly how you are dealing with the output/format of the attachment control to get the Library content.

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @WarrenBelz 

     

    Please find the flow screenshot below. Thanks.

     

    Iantaylor2050_0-1700700254775.png

     

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    @Iantaylor2050 ;

    Can you please open them out, particularly the Create File

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @WarrenBelz 

     

    Iantaylor2050_0-1700701213661.png

     

    Iantaylor2050_1-1700701291430.png

     

     

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @Iantaylor2050 ,

    I should have spotted this from your first post, but was looking for something difficult rather than something simple - on Submit

    ForAll(
     DataCardValue11_2.Attachments As file1,
     'UAT-UploadtoDocLib'.Run(
     {
     file: 
     {
     contentBytes: file1.Value,
     name: file1.Name
     }
     },
     DataCardValue3_2.Text,
     DataCardValue16.Text
     )
    );

     

    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

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @WarrenBelz 

     

    I tried the above but it throws error as per screenshot below.

     

    Iantaylor2050_0-1700706515482.png

     

     

    ForAll(
     DataCardValue11_2.Attachments As file1,
     'UAT-UploadQuotationtoDocLib'.Run(
     {file1:{
     contentBytes: file1.Value,
     name: file1.Name
     }},
     DataCardValue3_2.Text,
     DataCardValue16.Text
     )
     );
     ForAll(
     DataCardValue19_2.Attachments As file1,
     'UAT-UploadSupportingDocumentstoDocLib'.Run({file1:{
     {
     contentBytes: file1.Value,
     name: file1.Name
     }},
     DataCardValue3_2.Text,
     DataCardValue16.Text
     )
     );

     

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    @Iantaylor2050 ,

    You need file: not file1:

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @WarrenBelz 

     

    I tried with file and file 1. Still its erroring out.

     

    Iantaylor2050_0-1700707613732.png

     

  • WarrenBelz Profile Picture
    156,382 Most Valuable Professional on at

    Hi @Iantaylor2050 ,

    Exact code I tested here and ran perfectly sending all files to a Library

    WarrenBelz_0-1700708220240.png

    You might check you are sending the parameters in the right order and number. What is the error ?

     

  • Iantaylor2050 Profile Picture
    603 on at

    Hi @WarrenBelz 

     

    Below is the error message

     

    Iantaylor2050_0-1700709153154.png

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#2
11manish Profile Picture

11manish 205 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard