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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Update Content Type of...
Power Automate
Unanswered

Update Content Type of Email Attachment

(0) ShareShare
ReportReport
Posted on by 79

Hi everybody

 

I try to create a automated solution for tracking my working hours. 

I have therefore built a powerapps app where I can fill in a signature using PenInput. 

 

I transfer the PenInput via Office365.SendEmail() to my inbox. A rule in my inbox sends the mail automatically to a subfolder in my inbox. Whenever a new mail arrives in this subfolder, my flow gets triggered. 

 

It seems that everything works fine but one little detail always lets my flow fail: The action card in flow "Populate a Microsoft word template" is not able to fill the attached file in the placeholder in the template because it says, it is no png. When I was running the flow for testing I added a compose card to see what the content of the attachment is. My finding is, that it was of Content type: image / png. 

 

I try to substitute the content type "image/png" by the content type "png", but I don't know how to do that. 

 

Please help me. 

 

This is my flow (works fine without attaching a picture from powerapps)

Snag_13dad03.png

 

Here is my error warning. Saying:

Snag_13dbef4.png

 

Here is my approach to transform the email attachment to a variable. However, I want to change the content type to png. 

 

 

Snag_13dc6d4.png

 

Thanks

Peter

Categories:
I have the same question (0)
  • FoDelement Profile Picture
    435 on at

    Hello @PeterKuehlian 

     

    Try this in powerapps instead.

     

    Office365.SendEmailV2("YourEmail@domain.com", "Sig image", "",{Attachments:Table({Name:"Signature.png", ContentBytes:PenInput1.Image, '@odata.type':""})})

     

    (Assuming your peninput is called "PenInput1")

     

    This should have the signature come to you as a PNG like you are requesting. 

     

    EDIT: Apparently we cannot opt out of emojis.. 

     

    That reads ContentBytes: PenInput1.Image just without the space.

  • PeterKuehlian Profile Picture
    79 on at

    Hi @FoDelement 

     

    Thank you for your quick respond. 

    I tested the code in PowerApps as you suggested. 

     

    Unfortunetley that did not work 😞

     

    In Flow the Content Type still gets recognized as "image / png".

     

    In my Email Attachment in Outlook, I can open the png without any problems. But as soon as I want to fill the file in flow, the attached image does show as "image / png". However, the action card "populate a microsoft word template" can not work with this content type, as it is expecting a png or jpg file. 

     

    Do you have any other ideas?

     

    I also tried to replace the content type: image / png with just png. That did work with a compose card, however i were not able to replace the content type within the file via flow. 

     

    Snag_40f804.png

     

    This is my replace function:

    replace(outputs('Compose_2'),'image/','')
     
    I then tried to concat the content of the attachment and the content type like this:
    concat(outputs('Compose_3'),outputs('Compose'))
     

     

     

    Snag_3f8ea1.png

     

     

     

     

  • PeterKuehlian Profile Picture
    79 on at

    Does anyone has another suggestion how to get this work?

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 873

#2
Valantis Profile Picture

Valantis 820

#3
Haque Profile Picture

Haque 505

Last 30 days Overall leaderboard