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)
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.
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
});
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
}
);
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?
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
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
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional