cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

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
Jeff_Thorpe
Super User
Super User

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

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

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

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

Hi

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

 

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,969)