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 Apps / Refresh a gallery conn...
Power Apps
Answered

Refresh a gallery connected to Teams channel messages

(0) ShareShare
ReportReport
Posted on by 634

I am trying to figure out how to get a gallery that is connected to a Teams channel to refresh every time a new message is added. As of right now every time a new message is added to the Teams channel it does not automatically show upin my PowerApp.

Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Future_Vision ,

     

    I'm afraid there is no way to refresh the Gallery "every time a new message is added". But you could try and add a Timer to collect the result like every 5 seconds as the workaround.

     

    So, steps are as follows:

    1\ Add a Timer Control, set duration as 5000 (milliseconds),

     

    2\ OnTimerEnd of the Timer set to:

    ClearCollect(colMessages,MicrosoftTeams.GetMessagesFromChannel(Gallery1.Selected.id, Gallery1_1.Selected.id).value)

     

    3\ Use the collection as the data source of the Gallery.

     

    4\ In case the Gallery.Select value is lost, you'd better create variables to store them.

    Gallery1 select button:

    Set(varGroup, ThisItem.id)

    Gallery1_1 select button:

    Set(varChannel, ThisItem.id)

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Future_Vision Profile Picture
    634 on at

    @v-jefferni 

    Why would Gallery.Select value be lost? I'm not sure if it matters. This gallery is strictly a 'dashboard' to view what is basically a change history.

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Future_Vision ,

     

    Not quite matters just in case. Using variables to store Gallery.Selected could help clearly know which Gallery item has been selected if there are multiple Galleries.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Future_Vision Profile Picture
    634 on at

    Got it. I did notice an odd behavior when the gallery loads up. Some of the older messages do not show. Is there a reason why? I have/had a bunch of deleted messages in between. Does that have something to do with it or is there a limit to how far back Powerapps will pull messages?

     

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 421

#2
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 278 Super User 2026 Season 1

Last 30 days Overall leaderboard