Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

image not shown when Sending email attachment image to Teams using custom connector via Graph API

(0) ShareShare
ReportReport
Posted on by 4

I want to use power automate to send email attachment image (image/png) to Teams chat when new email arrived. I know this is not supported with offical power automate connectors, so I created one.

this is the email I received, and I want to automate get an Teams message with email attached image shown.

Nathan_Zhu_0-1704854161856.png

 

It works, but only with one last issue when sending message to Teams chat: image is not shown in the chat.

Nathan_Zhu_0-1704853470119.png

 

the API I used is : https://learn.microsoft.com/en-us/graph/api/chatmessage-post?view=graph-rest-1.0&tabs=http

in which, Example 5: Send inline images along with the message

Nathan_Zhu_1-1704853634228.png

 

In the Power automate Connector, with my own custom connector, I can send message to Teams chat without failure, but image is not shown correctly:

Nathan_Zhu_2-1704853748890.png

 

the Body/Body/Content is as:

Nathan_Zhu_3-1704853885183.png

And contentBytes is base64(items('For_each')?['contentBytes'])

Nathan_Zhu_4-1704853952467.png

 

I checked the develop doc, when new email arrive, items('For_each')?['contentBytes'] data type is byte. I'm wondering if this issue has something to do with data type...

 

I tried with contentBytes is items('For_each')?['contentBytes'], it runs with failure.

I also tried with contentBytes is base64(string(items('For_each')?['contentBytes'])),  it runs with failure as well.

 

Can someone help me what is the root cause, and how to correct this issue?

thank you!

  • Nathan_Zhu Profile Picture
    Nathan_Zhu 4 on at
    Re: image not shown when Sending email attachment image to Teams using custom connector via Graph API

    Anyone can help?

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,567

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard