Forum Discussion

McJasem's avatar
McJasem
Copper Contributor
May 10, 2021

Get Images (if any) from Microsoft Lists and post to teams via Flow

Hi all,

 

I've got a Microsoft Lists with different info, and i wish to post any changes in Lists into Teams. I've so far set it up that my Flow monitors the list and *if* there's an change with the Status value set to Publish - Flow will post this row into a teams channel. This works, but i've got issues with those rows that has an image/picture in it, won't get posted into team with the rest of the row content (text).

 

I've tried different methods, nut none have helped me include images into the postes teams message.

 

If you have some suggestions please share, thanks.. ??

2 Replies

  • RobElliott's avatar
    RobElliott
    Silver Contributor

    McJasem instead of the Teams Post a message action you need to use Post your own adaptive card as the flow bot to a channel.

     

    The sort of JSON you would need, including for the image, is as follows:

    {
        "type": "AdaptiveCard",
        "body": [
            {
                "type": "ColumnSet",
                "columns": [
                    {
                        "type": "Column",
                        "items": [
                            {
                                "type": "TextBlock",
                                "text": "REI News",
                                "wrap": true
                            },
                            {
                                "type": "TextBlock",
                                "spacing": "None",
                                "size": "Large",
                                "weight": "Bolder",
                                "text": "@{body('Get_file_properties')?['Title']}"
                            },
                            {
                                "type": "TextBlock",
                                "spacing": "None",
                                "text": "@{outputs('Compose_First_Published')} - @{outputs('Compose_Contact')}",
                                "isSubtle": true
                            },
                            {
                                "type": "TextBlock",
                                "size": "Small",
                                "text": "@{body('Get_file_properties')?['Description']}",
                                "wrap": true
                            },
                            {
                                "type": "Image",
                                "url": "@{body('Get_file_properties')?['BannerImageUrl']}"
                            }
                        ],
                        "width": 2
                    }
                ]
            }
        ],
        "actions": [
            {
                "type": "Action.OpenUrl",
                "title": "Go to news article",
                "url": "@{body('Get_file_properties')?['{Link}']}"
            }
        ],
        "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
        "version": "1.0"
    }

     

    This would give you a result like this:

     

    Rob
    Los Gallardos
    Microsoft Power Automate Community Super User

    • McJasem's avatar
      McJasem
      Copper Contributor
      Hi Rob

      Thanks for the great advice, but i'm still a novice and the JSON code isn't something i'm familiar with. Could you perhaps explain, or do you have a work around that don't need JSON code?

      /McJasem

Resources