Now we will see how to Post Message to Microsoft Teams through PowerApps using gallery control instead of drop-down.
In our previous blog, we used drop down and we were just showing GUID of the MS Teams. We have done few enhancement to our application and tried to make it more better as per few reader’s inputs.
Agenda:
Establish Data Connection to MS teams
Create Screen and Formulas for controls
Results
Establish Data Connection to MS teams
Click View -> Data sources
Add data source -> New Connection -> Select Microsoft Teams
Create Screen and Formulas for Controls
We will add a screen under the screens tab of our application. Screen shot of my screen is below.
Figure 1
We will discuss each control in details below:
Figure 2
In above screen shot, we are using labels, gallery and button controls. Each control is explained below.
Label > Text > "Select Team Name: " Gallery > items > MicrosoftTeams.GetAllTeams().value Label which is showing MS Teams display name > Text > ThisItem.displayName Label holding MS Teams GUID > Text > ThisItem.id –> Hide this control as no need to display. Select Team Button > OnSelect > Select(Parent) Gallery > TemplateFill > If(ThisItem.IsSelected, YellowGreen, White)
Figure 3
Label > Text > "Select Channel Name: " Gallery > items > MicrosoftTeams.GetChannelsForGroup(Gallery4.Selected.id).value Label which is showing Channel display name > Text > ThisItem.displayName Label holding Channel's GUID > Text > ThisItem.id –> Hide this control as no need to display. Select Channel Button > OnSelect > Select(Parent) Gallery > TemplateFill > If(ThisItem.IsSelected, YellowGreen, White)
Almost replica, what we used earlier.
Figure 4
Label > Text > "Type Message: " TextInput > Default Blank Label showing required field > Text > "**Required Field" & Visible > If(TextInput1.Text="" || IsBlank(TextInput1),true,false) POST Button > OnSelect > MicrosoftTeams.PostMessageToChannel(Gallery4.Selected.id,Gallery3.Selected.id,{body:{content:TextInput1.Text,contentType:0}});Reset(TextInput1) POST Button > DisplayMode > If(TextInput1.Text="" || IsBlank(TextInput1),DisplayMode.View,Edit)
For any query send us email at [email protected]. If you like this post then share it and subscribe to our website to stay updated on future posts. Thanks for visiting our site.
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Connect with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
3 Comments
Oldest
NewestMost Voted
Inline Feedbacks
View all comments
Shashi
6 years ago
have you used MicrosoftTeams.PostReplyToMessage to reply to a message
Hi Shashi,
I haven’t done yet but I created a sample one for you.
I created one more gallery as shown in below Image.
Items for the gallery is MicrosoftTeams.GetMessagesFromChannel(Gallery4.Selected.id,Gallery3.Selected.id).value
and label is equal to ThisItem.id
Reply Message Button’s formula is given below.
MicrosoftTeams.PostReplyToMessage(Gallery4.Selected.id,Gallery3.Selected.id,Gallery3_1.Selected.id,{content:TextInput1.Text,contentType:0},{subject:”Test”})
Hope this will help you.
Matthew Flynn
5 years ago
Hi
Have you used “MicrosoftTeams.PostChannelAdaptiveCard” before? Can’t seen to figure it out. The syntax only accepts the groupid – I can’t seem to give any content.
have you used MicrosoftTeams.PostReplyToMessage to reply to a message
Hi Shashi,

I haven’t done yet but I created a sample one for you.
I created one more gallery as shown in below Image.
Items for the gallery is MicrosoftTeams.GetMessagesFromChannel(Gallery4.Selected.id,Gallery3.Selected.id).value
and label is equal to ThisItem.id
Reply Message Button’s formula is given below.
MicrosoftTeams.PostReplyToMessage(Gallery4.Selected.id,Gallery3.Selected.id,Gallery3_1.Selected.id,{content:TextInput1.Text,contentType:0},{subject:”Test”})
Hope this will help you.
Hi
Have you used “MicrosoftTeams.PostChannelAdaptiveCard” before? Can’t seen to figure it out. The syntax only accepts the groupid – I can’t seem to give any content.