Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Base64 from Outlook email attatchment

(0) ShareShare
ReportReport
Posted on by 232

Hi,

 

I'm stuck trying to get a email attatchment image to base 64.

 

I'm attempting to set a variable with the Attachments Contents ['contentBytes'] dynamic content, which I'm intending to use base(64) to give me the output I need. But I get this error:

 

Unable to process template language expressions in action 'Set_variable_3' inputs at line '1' and column '29003': 'The template language function 'base64ToString' expects its parameter to be a string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#base64ToString for usage details.'.

 

In case this is anythning to do with it: when I look at the output from the tigger strangely it says that has attachement is false, however there is an attachments as you can see.

 

Mozilla_Firefox.png

Any help appreciated.

  • Verified answer
    v-bacao-msft Profile Picture
    on at
    Re: Base64 from Outlook email attatchment

     

    Hi @mrpowergage ,

     

    Sorry for my late reply!

    I have tested it on my side, but there is nothing abnormal, Flow can run normally, the following is my Flow configuration. Include Attachment is set to Yes, Has Attachment is set to No.

    135.PNG

    It is worth noting that if you add a picture to the email body, the result of Has Attachment will be false, because the picture in the email body is not recognized as an attachment. But it can still be obtained by Flow, as long as you set the Include Attachment to Yes.

    If it is an image added using Attach File, the result of Has Attachment will be true.

     

    The above premise is that the Email body or the attachment contains pictures, then the Set variable action can be executed normally. Please ensure that such conditions are met.

    Please try to recreate a similar Flow and try again.

     

    Best Regards,

  • mrpowergage Profile Picture
    232 on at
    Re: Base64 from Outlook email attatchment

    Hi @v-bacao-msft any update on this? thanks

  • mrpowergage Profile Picture
    232 on at
    Re: Base64 from Outlook email attatchment

    Thanks @v-bacao-msft 

     


    Please try setting Include Attachment to Yes.


    makes no difference.

     

    Here is the top of the flow. I get the error on set variable 3.

     

    Edit_your_flow___Power_Automate-2-2.png

     

    Edit_your_flow___Power_Automate-3.png

    The Value in Set Variable 3 is: @{items('Apply_to_each_3')?['contentBytes']}

     

    Thanks for your help.

  • v-bacao-msft Profile Picture
    on at
    Re: Base64 from Outlook email attatchment

     

    Hi @mrpowergage ,

     

    Please try setting Include Attachment to Yes.

    Please also provide a screenshot of the Flow configuration so that we can provide you with a suitable solution.

     

    Best Regards,

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1