Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Adding Attachments to SharePoint List

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

 

I have the below code on a button via the OnSelect, can you tell me how I can add the attachments that the user uploads to my sharepoint list please? They are coming through via email fine but I can't get them into the sharepoint list, I need both the attachments and the signature:

ClearCollect(

   colImages,

   AddColumns(

      RenameColumns(

          AttachmentControl.Attachments,

          "Value",

          "ContentBytes"

      ),

      "@odata.type",

       ""

   ),

   {

      Name: "Signature.jpg",

      ContentBytes: Signature.Image

   }

);

 

Office365Outlook.SendEmailV2("emailaddress@mydomainname.com" , 'Result Job Number'.Text , "Hi,<br><br>

 

Please see completed survey form below and attached drawings<br><br>

 

<a href=https://mydomainname.sharepoint.com/sites/PowerApps/Lists/DoorSurvey/AllItems.aspx>Click Here to View the Full SharePoint List</a><br><br>

 

<b>Customer: </b>"&Customer.Text&"<br>

<b>Address: </b>"&Address.Text&"<br>

<b>Job Number: </b>"&'Job Number'&"<br>

<b>Surveyor: </b>"&Surveyor.Text&"<br>

<b>Date: </b>"&Date.SelectedDate&"<br><br>

 

<b>Notes: </b>"&Notes&"<br><br>

 

Regards<br><br>

 

IT Department<br></br>",

 {Attachments: colImages}

);

Reset(AttachmentControl);

Reset(Signature)

;

Patch(DoorSurvey, Defaults(DoorSurvey),

{

Title: ValueDateTimeNow.Text,

Customer: Customer.Text,

'Site Address': Address.Text,

'Job Number': 'Job Number'.Text,

Surveyor: Surveyor.Text,

Date: Date.SelectedDate,

Notes: Notes.Text

});

Navigate(Success,Cover)

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Adding Attachments to SharePoint List

    Hi @Dave-ITMan ,

    Using the same principle as in my blog, except this is not an easy one after that and involves sending the collection to Power Automate and creating an Array Variable from it. You might post this on the Power Automate Community.

  • Dave-ITMan Profile Picture
    on at
    Re: Adding Attachments to SharePoint List

    I'm also using patch to get the results into my sharepoint list if that helps?

    {Attachments: colImages}

    );

    Reset(AttachmentControl);

    Reset(Signature)

    ;

    Patch(DoorSurvey, Defaults(DoorSurvey),

    {

    Title: ValueDateTimeNow.Text,

    Customer: Customer.Text,

    'Site Address': Address.Text,

    'Job Number': 'Job Number'.Text,

    Surveyor: Surveyor.Text,

    Date: Date.SelectedDate,

    Notes: Notes.Text

    });

  • Dave-ITMan Profile Picture
    on at
    Re: Adding Attachments to SharePoint List

    Hi @WarrenBelz ,

    So i'm collecting any images/files that are uploaded via an attachment control, there is also a peninput box for a signature which is being collected using the below code. What i'm trying to do is get all of those images/files and also the signature to upload to my sharepoint list in the attachments area of the record with the results from what they've filled out in the form. Hopefully this makes more sense

    ClearCollect(

       colImages,

       AddColumns(

          RenameColumns(

              AttachmentControl.Attachments,

              "Value",

              "ContentBytes"

          ),

          "@odata.type",

           ""

       ),

       {

          Name: "Signature.jpg",

          ContentBytes: Signature.Image

       }

    );

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Adding Attachments to SharePoint List

    Hi @Dave-ITMan ,

    You have lost me a bit there - you already have them on an Attachment control. What are you trying to add and how are you collecting it?

  • Dave-ITMan Profile Picture
    on at
    Re: Adding Attachments to SharePoint List

    Hi @WarrenBelz ,

    Thanks for the quick response, that's about emailing the attachments which i've done but i'm trying to get the attachments and the signature into a sharepoint list

  • WarrenBelz Profile Picture
    146,524 Most Valuable Professional on at
    Re: Adding Attachments to SharePoint List

    Hi @Dave-ITMan ,

    I have a blog on various parts of this process that may be useful to you.

     

    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.

    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

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

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard