Skip to main content

Notifications

Power Automate - General Discussion
Answered

Embedding an image into a Teams message - image too small

(0) ShareShare
ReportReport
Posted on by

I've created a flow that takes today's Dilbert comic image from the web and posts it as a message. I'm alost there, but have fallen at the last hurdle!
The issue I have is that the image posted is too small. If I post the image myself, it looks nice and big as it should be. And the the weird thing is, if I edit the message posted as me using flow, it enlarges it and fills the message box.

 

Message posted manually by me:

mccoydblueloop_5-1616111030577.png

 

Message posted by the flow bot:

mccoydblueloop_1-1616110871146.png

 

Message posted by flow as me:

mccoydblueloop_2-1616110898757.png

 

Message posted by flow as me. I then selected "edit" and pressed "send" without making any changes, it magically pops back to full size:

mccoydblueloop_4-1616110960680.png

 

Here's the flow:

mccoydblueloop_7-1616111196508.png

The substring pulled from the HTML and being inserted in the <img> tag is this:

 

 

https://assets.amuniversal.com/6e112be05f5701394ecc005056a9545d

 

 

I've tried adding a width="600" but it doesn't work. So I had no option but to inspect the Teams page which not being a web designer or coder, is probably pointless, but it seems to put it in a image.ts container that is 300px wide:

 

Screenshot 2021-03-18 235958.png

 
 
 
 

Any help with this is appreciated!

  • FabvE Profile Picture
    FabvE 79 on at
    Re: Embedding an image into a Teams message - image too small

    Hi,

    I know this thread is quiet old but the suggested solution doesn't work (anymore?) for images hosted on SharePoint and New Teams.

    When I use the above method my posting looks like this:

    FabvE_0-1720160175864.png

    Using the plain URL in the browser shows the correct image.

    Is there anything I can do? 🙂

  • Re: Embedding an image into a Teams message - image too small

    Yes, that works! I've put the substring generated by the flow in there. Looks perfect. I'm guessing the 803.5714285714286 number is the proportionate width when the height has to be 250px? In any case, that works as intended.

  • Verified answer
    DamoBird365 Profile Picture
    DamoBird365 8,942 on at
    Re: Embedding an image into a Teams message - image too small

    @Anonymous 

     

    Really quite an interesting idea!  When can I come and work with you guys?  Comics in the morning 👍

     

    I had success with:

    <img class="ts-image" target-src="@{outputs('Compose')}" width="803.5714285714286" height="250" lazy-load="true" data-tid="messageBodyImageSrc" style="width: auto; height: auto" src="@{outputs('Compose')}">

     

    Where I have inserted the url into a compose.  

     

    I found that if I removed the width and height it shrunk back down to a mini version.  Maybe you could have a play with that string and report back?  Hopefully that is helpful.

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
    Cheers,
    Damien


    P.S. take a look at my new blog here

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,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard