As a proof of concept, I'm trying to build a flow that will post an adaptive card to a Teams channel with my profile mugshot in the message body.
The only components I can find to return my profile image, return the raw content, rather than a URL....is there a way to get this working?
Hi @GRAEMEJOHNSON , thank you for your post.
I have had a fair crack at this, I have it posting images but you won't be able to use "Get user photo (V2)". The output from that is the actual file, not a URL to a file.
So, to get this to work, some information on this post will be helful to you - https://sharepoint.handsontek.net/2018/10/05/how-to-get-sharepoint-profile-picture/
I have got it working with Graph and Delve Urls although an option could be to get the photo in the way you have, save it to SharePoint or OneDrive then call back it's Url in that way. There is a create sharing link action that will do this when in SharePoint.
There's a few ways to go at it but it will need to be a url that you use in your JSON for the adaptive card.
If you have found my post helpful, please mark thumbs up.
Any other questions, just ask.
Well....I got this working by adding a Compose action to Base64 encode the binary image data....
...then within the message body of the adaptive card, reference the Output within a 'Data' tag....
This is the end result
However - with other user's profile pictures it does not work! Don't know whether it's down to some limit on the size of an adaptive card payload?
Your solution does not work for me at this time.
I do not get any errors in Flow but the image is not shown in the adaptive card.
If i put the image url in a browser i can download the jpg image.
@geraldclerc , I noticed that the pictures from the adaptive cards I had created previously are now mysteriously gone. I'm guessing MS changed something that broke it. I don't have another solution at this point.
I tried using all mothods posted here, sharepoint URL just displays blanks and the method Grmae posted using the base64conversion and the flow fails with the follwoing error.
The specified Teams flowbot adaptive card request is missing or invalid.
We really need to get this working for a varieity of Adaptive cards we are building. Any guidance is appreciated.
Is this still working for you? All my images in adaptive cards are no longer working using this. Seems silly how much screwing around this is to get an image to work.
At this point I would love to see some documentation or some clear direction on the proper method to include an employee image from either delve, sharepoint, graph, etc. I really don't care where it comes from, simply want to see it work.
Both sharepoint and delve have worked and now neither are working.
I figured that, it would be great if someone could chime in here and provide some direction on the proper way to display an employee photo on an adaptive card. I have tried every method in the post below and none of them work, some of them worked just a few weeks ago and now they all display the default no image icon.
Facing this problem today, solved using this url : https://teams.microsoft.com/api/mt/emea/beta/users/<user mail>/profilepicturev2?displayname=<user diplay name>&voidCache=false
Replace bold sentences by your parameter and boom its' done !
mcorlou that's an interesting way to do it. Not sure what the correct URL would be for NA? Seems strange that method requires more than simply the email and also the display name. Could you please confirm this method actually displays the image in both the teams client and web version?
I just realized the previous method I have been using has been working all along however only in the web version of teams. Where most if not all versions stopped working is within the Teams client.
This is the method I am currently using works only in the web version and not the Teams client.
I'm having the same issue with profile pic, but I'm also curious if anyone is able to see any images posted to SharePoint in the Teams desktop client.
I created a quick Power App that takes a photo and passes it to Flow which (does some other stuff) and eventually posts an adaptive card to Teams. I'd like to store the image in the Teams SharePoint site, but no matter what I try, I can't get it to render in the Teams client.
When I post the card as the Flow Bot, the Image renders perfectly in the web version of Teams, but is completely ignored by the Teams Desktop Client. The only time I can get the Teams Desktop Client to admit that there could be an image to display is if I change the size from Auto to Small, Medium, Large, etc. It won't display the image, but at least it displays a placeholder.
Other relevant facts...
Am I crazy, or does this seem like some kind of a permission issue with the Teams client and images that require authentication?
I am trying something compareable, but not with a profile picture, but with a picture attached to a list-item.
I can include any public picture, but not the one stored in my sharepoint list which i access in the Flow.
So it seems the adaptive card, that is not send by the user itself, but as a flow-bot does not have the permisson.
It would be great if this could be confirmed and of course it would be great if there is any solution.
I can delete that attachment or send it to someone else by mail... wo why not send it as the flow-bot.
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!