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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Refresh a gallery conn...
Power Apps
Unanswered

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard