cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Mail attachments from a form via Mail connector

Hey,

 

in Power Apps I've made a app that let people fill in a form (linked to a SP-list). They also can add attachments (in a Attachmentcontrol). When they click on a button "submit" I also want to send an email with the provided info and the added attachments as mailattachments. 

On the OnSelectproperty of the button I linked a Flow with the Mail connector. The mailattachments are 'asked in power apps'. 

Now I want to send the added attachments in the Attachmentcontrol to the Flow, but I can't figure it out. My OnSelect-code looks like this:

'MyFlow'.Run("mail@mail.com"; "Subject"; "Body";Attachmentcontrol.Attachments.Value)

 

This returns a table with the column 'Value' and the Blob-values as records. It requires a 'Blob-value'. Anyone an idea how to send those file(s) (multiple attachments are possible) to the Flow?

 

Thanks in advance!

Btw: no, I can't use the Outlook-connector due to company restrictions.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @Verlet ,

 

What you need to do is to pass the file content to flow, but you need first to encode the file content to Base64 format in PowerApps via JSON function, then convert the Base64 to binary in flow. You can refer to the Shane's video, where introduce the detailed process and steps and some points of attention. PowerApps upload file to SharePoint document library .

In the video shane uploads the file back into SharePoint library, but with the email Attachment, you need to put the final binary file content(base64ToBinary(...)) into the Attachment field.

 

However, the Send an email notification (V3) action from Mail connector only supports one attachment. so I am afraid you can only pass one file in attachment control to flow.

Hope this helps.

Sik

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

where are your attachments stored? I have found OneDrive to work the best for mail connector.

 

if you save your attachment to onedrive, you can easily find the attachment via the name of the file and then attach in an email.

Matter of fact, there is a good template you can use as an example.

https://flow.microsoft.com/en-us/galleries/public/templates/223e2fb0d67411e6bff5f31e794abff5/send-sp...

Highlighted

It is stored as an attachment in the record from the SP-list. But at that moment it's just in the attachmentcontrol, it's not submitted yet. I've added an example of the functions of the app.

 

You're solution can't be used because I don't have the Outlook connector. I can only use the mail (SendMailNotificationV2) connector.

Highlighted
Community Support
Community Support

Hi @Verlet ,

 

What you need to do is to pass the file content to flow, but you need first to encode the file content to Base64 format in PowerApps via JSON function, then convert the Base64 to binary in flow. You can refer to the Shane's video, where introduce the detailed process and steps and some points of attention. PowerApps upload file to SharePoint document library .

In the video shane uploads the file back into SharePoint library, but with the email Attachment, you need to put the final binary file content(base64ToBinary(...)) into the Attachment field.

 

However, the Send an email notification (V3) action from Mail connector only supports one attachment. so I am afraid you can only pass one file in attachment control to flow.

Hope this helps.

Sik

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (1,827)