cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

I really don't understand this string

Hi

I am trying to understand this string example, but the part with "body" I don't get. Can somebody helt me, best with an example with some text

 

MicrosoftTeams.PostMessageToChannel (string groupId, string channelId, PostMessageToChannelParameterBody body)

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: I really don't understand this string

Still have trouble, here is my string as it is now

 

MicrosoftTeams.PostMessageToChannel(ListTeams.Selected.id;ListKanaler.Selected.id;{body:{content:"Hello World Test",contentType:0}})

6 REPLIES 6
Super User
Super User

Re: I really don't understand this string

The body parameter needs to be a record type. After playing around with it I think I have it figured out.

 

function: PostMessageToChannel(groupId, channelld, rootMessage)

 

groupld: unique id of the Team (string)

channelld: unique id of the channel (string)

rootMessage: message to be posted (record)

 

Example:

MicrosoftTeams.PostMessageToChannel("[Team GUID]","[Channel GUID]", {body:{content:"Hello World Test",contentType:0}})

 

This will post the message "Hello World" in the channel conversations.

 

The rootMessage body record is made up of these values:

content: message to be posted

contentType: 0 for text or 1 for html



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Anonymous
Not applicable

Re: I really don't understand this string

Still have trouble, here is my string as it is now

 

MicrosoftTeams.PostMessageToChannel(ListTeams.Selected.id;ListKanaler.Selected.id;{body:{content:"Hello World Test",contentType:0}})

Anonymous
Not applicable

Re: I really don't understand this string

Still have trouble, here is my string as it is now

 

MicrosoftTeams.PostMessageToChannel(ListTeams.Selected.id;ListKanaler.Selected.id;{body:{content:"Hello World Test",contentType:0}})

Super User
Super User

Re: I really don't understand this string

Assuming that ListTeams.Selected.id returns the Team GUID as string and that ListKanaler.Selected.id returns the Channel's GUID as a string then the only difference I see is that your parameters are seperated by a semicolon (";") and my example is using a comma (","). I tested the example code out in a PowerApp and it worked just fine. What is the error you are getting?



--------------------------------------------------------------------------------
If this post helps answer your question, please click on “Accept as Solution” to help other members find it more quickly. If you thought this post was helpful, please give it a Thumbs Up.
Anonymous
Not applicable

Re: I really don't understand this string

Hi

Everything works perfect now, and I have clicked "Accept as solution" - thanks a lot for your help

jayprakash
Level: Powered On

Re: I really don't understand this string

 

Can you tell me where I will put Subject in this function

 

MicrosoftTeams.PostMessageToChannel("ae8bf00a-3838-4540-942a-e9a4677387ec","19:d2df2f11d0ec4f8989d2c1592c736a92@thread.skype", {subject:"hello jp", body:{content:"<p>dfgdfgdfg</p>",contentType:1}})

 

- wrote: Jayprakash Birla


@Anonymous wrote:

Hi

Everything works perfect now, and I have clicked "Accept as solution" - thanks a lot for your help


 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 218 members 4,210 guests
Please welcome our newest community members: