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

Flow to download file from dataverse record and send as email attachment

I'm in the process of building an order management system as a model driven power app for one of our teams that runs a small advertising agency. I have a table for orders which includes a field to attach a .docx or .pdf file which contains a draft of the prospective ad.


I have built a flow which will be triggered on demand as part of a business process flow and I want it to grab the .docx file from the dataverse record and send it as an email attachment. The flow is 95% working, however the file attachment doesn't have a file extension so cannot be quickly opened by the recipient (the recipient can rename the file to add the file extension... but that's not an acceptable workaround).


In the flow I'm using the Dataverse 'download a file or image' action to grab the file. Then I'm using the 'Send an Email (V2)' action to compose the email. I have tried adding the .docx file extension to the 'Attachments Name' field but that causes the flow to fail.


Any ideas on how to successfully use flow to get a file from a dataverse record and send it as an email attachment with the full file extension?

1 ACCEPTED SOLUTION

Accepted Solutions
gobarrows
Frequent Visitor

Thanks @ChrisPiasecki. Wasn't quite what I was looking for but I found a way to make this work. 

 

Just in case anyone else experiences this issue, I found that the Flow only worked if I populated the 'attachment content' field AFTER populating the 'Attachments Name' field (including file extension). If you edit the attachments name, then delete and then re-add the content to the attachment content field. Hope this may help if you've experienced a similar issue.

View solution in original post

2 REPLIES 2
ChrisPiasecki
Dual Super User
Dual Super User

Hi @gobarrows,

 

You can query the File Attachments table to retrieve the file name of the file attachment.

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

gobarrows
Frequent Visitor

Thanks @ChrisPiasecki. Wasn't quite what I was looking for but I found a way to make this work. 

 

Just in case anyone else experiences this issue, I found that the Flow only worked if I populated the 'attachment content' field AFTER populating the 'Attachments Name' field (including file extension). If you edit the attachments name, then delete and then re-add the content to the attachment content field. Hope this may help if you've experienced a similar issue.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (3,430)