web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Converting email attac...
Power Automate
Unanswered

Converting email attachment to base64 string

(0) ShareShare
ReportReport
Posted on by

Hi i have a flow where attachments from email should send to api in base64 format i'm using apply to each im calling my api in apply to each where in im sending attachment content as base64 string to my api but it is not working i tried to use binary() in expression but attachment content is not showing to keep in binary expresssion so i tried typing binary(attachmentcontent) as value for my api but its not working can anyone provide solution for this i need to send multiple attachments from mail as base64 string to api.Thanks in Advance 🙂.

Categories:
I have the same question (0)
  • v-litu-msft Profile Picture
    on at

    Hi @Anonymous,

     

    You could use the base64() function convert the Email attachment into base64, if you have multiple attachments, and want to send them all together, you could initialize an array variable, then use the Append to array variable to extract each attachment and store it:

    Annotation 2020-04-21 105031.png

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Hi @v-litu-msft thanks for your suggestion  i'm sending one by one not all at a time to my api can you show me your expression clearly ? what i should do is i should initialize variable and in apply to each by using set variable in the value section of set variable i'm writing the expression what you said and im using that variable to my api i think the expression is wrong can you show me expression clearly or i should write directly expression in my base64 api value can i see your expression ?.

  • v-litu-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Sorry, there is the completed expression:

    base64(body('Get_Attachment_(V2)')?['contentBytes'])

     

    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.

  • Community Power Platform Member Profile Picture
    on at

    Hi

  • v-litu-msft Profile Picture
    on at

    Hi @Anonymous,

     

    Could you confirm the content type if it has a value? I test on my side but it works correctly.

    Annotation 2020-04-22 171749.png

     

    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.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    Hi @v-litu-msft  My issue got resolved yesterday anyways thanks for your suggestion and quick response i used byte data type and used attachments content as value in byte data type it works fine.

  • CU-19081228-9 Profile Picture
    on at

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard