Here’s how you can use Power Automate to randomly select an image or GIF and post it in a Microsoft Teams message.
You will first need the URL of the images or GIFs you would like to use. When the flow is run, one will be randomly selected and posted in a Microsoft Teams chat.
In this example, I’ve selected the following 5 GIFs from https://giphy.com/sunnyfxx/
To get the URL, you will need to right click on the image/GIF and select Copy image address.
In your flow, add in the action Initialize variable with the following values:
Value: Here you will need to paste in the URLs of your GIFs/images. They will need to be in the format of [“URL1”, “URL2”, “URL3”, “URL4”, “URL5”]
Next, add in the Microsoft Teams action Post a message in a chat or channel. The Post as and Post in values can be up to you. In the Message field, type in your message (if required) then click on the code view button.
On a new line, type the following:
Backspace the word EXPRESSION and replace it with the following expression. You may need to type it out rather than copy and paste if you receive an error.
The expression should be in between “” without any spaces.
Save the flow and it is ready to go. Run the flow to see it in action.