Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • Future_Vision Profile Picture
    634 on at
    Re: Refresh a gallery connected to Teams channel messages

    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?

     

  • v-jefferni Profile Picture
    on at
    Re: Refresh a gallery connected to Teams channel messages

    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
    Re: Refresh a gallery connected to Teams channel messages

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

  • Verified answer
    v-jefferni Profile Picture
    on at
    Re: Refresh a gallery connected to Teams channel messages

    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.

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard