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

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
Highlighted
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
Highlighted
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!

Highlighted
Advocate IV
Advocate IV

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

Highlighted
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

Highlighted
Advocate IV
Advocate IV

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

Thanks. The binary function works perfect

Highlighted
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

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

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!

Top Solution Authors
Top Kudoed Authors
Users online (10,091)