cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Oos
Level: Powered On

image from mail-attachment to base64 for plumsail docx

I am filling a docx template with pictures using the plumsail action.

I have a few attachments in my mail what .jpg photos are. 
How do i get these attachments in BASE64 so i can use them in the template?

When i use the formula:

base64(items('Attachments_maill')?['ContentBytes'])

I dont get a correct base64 formula. It is not starting with 'data:image/png;base64,' and i dont get it filled in the template. 
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: image from mail-attachment to base64 for plumsail docx

Hi @Oos 

 

When you put it into a variable of type string, it will do that. If you want to put that in a variable you should use the binary() function. Wrap the attachment content in the binary() function and add the expression in the variable. 

 

Hope this Helps!

View solution in original post

5 REPLIES 5
Dual Super User
Dual Super User

Re: image from mail-attachment to base64 for plumsail docx

Hi @Oos 

 

Can you please share more details on this? If you are getting attachments from mail, the Attachment content is already base64 encoded and you do not have to encode it any further. 

 

Can you please share a screensot of the flow so that we might be able to assist you better?

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Oos
Level: Powered On

Re: image from mail-attachment to base64 for plumsail docx

Knipsel11.PNG

Im using the Attachment content - Dynamic content. And if i put this in a variable i get this:
Knipsel22.PNG

This input is definitily not base64

Dual Super User
Dual Super User

Re: image from mail-attachment to base64 for plumsail docx

Hi @Oos 

 

When you put it into a variable of type string, it will do that. If you want to put that in a variable you should use the binary() function. Wrap the attachment content in the binary() function and add the expression in the variable. 

 

Hope this Helps!

View solution in original post

Oos
Level: Powered On

Re: image from mail-attachment to base64 for plumsail docx

Thanks. The binary function works perfect

Dual Super User
Dual Super User

Re: image from mail-attachment to base64 for plumsail docx

@Oos 

 

Glad that it worked! Happy Flowing 🙂

Helpful resources

Announcements
firstImage

Better Together Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

firstImage

Incoming: New and improved badges!

Look out for new contribution recognition badges coming SOON!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,344)