cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate III
Advocate III

Store File content in a variable

Hi, I'm trying to work out if it's possible to store the content output of 'get file content' in a variable. Have been trying to do this in a string variable and then add an attachment to an email with the variable in the 'content' part of the attachment but the attachment is not able to be opened when I receive the email.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Store File content in a variable

Hi @JamesSnaps 

 

Try the below.

 

image.png

 

Next you need to append the array with filename and content

 

image.png

 

Finally add your attachments in your email.

 

image.png

 

Note: If you file content type is binary then convert it using base64() expression. Here in my example I am using CDS database which is already getting the document in base64 format.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Store File content in a variable

hi @JamesSnaps  you can apend the variables.

apend.PNG



Did I answer your question? Please consider to Mark
my post as a solution! to guide others :winking_face:

Proud to be a Flownaut!


If you want you can follow me at www.christianabata.com Quieres contenido en español? Síguenos en Power Automate LA
Highlighted
Super User III
Super User III

Re: Store File content in a variable

Hi @JamesSnaps 

 

Try the below.

 

image.png

 

Next you need to append the array with filename and content

 

image.png

 

Finally add your attachments in your email.

 

image.png

 

Note: If you file content type is binary then convert it using base64() expression. Here in my example I am using CDS database which is already getting the document in base64 format.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Highlighted
Community Support
Community Support

Re: Store File content in a variable

Hi @JamesSnaps,

 

Could you please share the configuration of your Flow by screenshots?

I think the reason for the received email couldn't open the attachment is the content code format, you could refer to this similar post to learn how to convert the content into base 64 and try it again:

https://powerusers.microsoft.com/t5/Building-Flows/Send-mail-with-attachment-when-a-new-message-and-...

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Advocate III
Advocate III

Re: Store File content in a variable

Many thanks, just tested this and works like a treat. Did have to convert to base64, but that's easy enough. Much appreciated.

 

James

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,924)