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

View solution in original post

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

View solution in original post

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
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,161)