web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Automating PA to Post ...
Power Automate
Unanswered

Automating PA to Post Tips of the Day in Teams

(0) ShareShare
ReportReport
Posted on by 21

Hi, I am trying to figure out a way to automate PA to grab random tips from a list and post it to a group chat as a way to automate "Tips of the Day." How would I go about accomplishing this and what would be the optimal program for the list for PA to pull from?

 

Thanks in advance!

Categories:
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @haridavid ,

     

    We can try the rand function.

    https://learn.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#rand

    Sample:

    vxiaochenmsft_0-1685594559608.png

    vxiaochenmsft_1-1685594721311.png

    outputs('Get_items')?['body/value']?[rand(0,length(outputs('Get_items')?['body/value']))]?['Title']
    vxiaochenmsft_2-1685594742008.png

     

    Best Regards,

    Wearsky

  • haridavid Profile Picture
    21 on at

    @v-xiaochen-msft This looks great. I know I said lists but is there any way to format the input and include images? 

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @haridavid ,

     

    Sorry, I don't understand your needs.

     

    Best Regards,

    Wearsky

  • haridavid Profile Picture
    21 on at

    @v-xiaochen-msft Sorry if it was unclear. Essentially what I want to happen is to automate a list of formatted messages. Some of the tips would have images to show how the tip would be used in practice. Something like this:

    Ex: 

    haridavid_0-1685596541033.png

    Is there a way to have PA pull randomized tips that is formatted and with images and post it on Teams?

  • Rhiassuring Profile Picture
    8,692 Moderator on at

    Sorry this is not related to a solution, but, that is a fantastic tip.

  • AWorley Profile Picture
    414 Super User 2024 Season 1 on at

    You should upload all images to a sharepoint folder and use the "Get Content" action from Sharepoint to pass that image into a Teams message; in order to select the proper image you should name the file and the resulting tip with a unique identifier that you can pull both off using a Condition action or switch.

     

    A switch condition would be the preference. 

     

     

  • haridavid Profile Picture
    21 on at

    @AWorley Could you show me how this would be done? I'm still learning how to use PA and would appreciate the assistance.

  • AWorley Profile Picture
    414 Super User 2024 Season 1 on at

    Just upload the images to a sharepoint directory. Name them something like 1.png. Do a second switch on the random number that is a concat() expression of the number and the file extension. Then place that file extension in the file path “get content” action of sharepoint’s connector. 

    should be something like shareddocuments/images/tips/concat(“1”,”.png”)

     

    obviously put the dynamic content in the 1 slot. 

    that’ll pull the matching image to the numerical value for rand(). 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard