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

Getting channel ID for channels in Teams

Hi I am trying to Post  A Message in a (MS Teams) Team, when a file is posted in a specific Channel.

 

The Team has multiple Channels so I am using the following Substing Function that extracts the Channel Id from the file path:

substring(triggerBody()?['{Path}'],17,sub(sub(length(triggerBody()?['{Path}']),1),17))

 

 

The Flow does not run the Post to Teams Section

The error message is as follows:

{
"error": {
"code": "InvalidRequest",
"message": "Channel id is not in a valid format: SBHI - Coffee Garden",
"innerError": {
"request-id": "29db7621-484a-4f78-a7a7-f35a921522b1",
"date": "2019-01-02T03:10:34"
 
 
Please Help
2 ACCEPTED SOLUTIONS

Accepted Solutions
v-yamao-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you share a screenshot of your flow?

The error message says that the channel id is not in a valid format, I assume that it requires a GUID but not a text name.

I have made following flow for your reference.

Add the trigger When a file is created or modified (properties only) to get the folder path.

Add a Compose action to get the specific channel name:

substring(triggerBody()?['{Path}'],0,sub(length(triggerBody()?['{Path}']),9))

Then list channels from a team.

Add a Condition to check if the Compose output equals to the Channel name.

Under if yes branch, add action Post message. Select dynamic content Channel Id from the previous action.

1.PNG2.PNG 

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

AWESOME Thank You it is Working Perfectly now thanks

 

FYI,

 

Your Compose substring was incorrect, so I used the following:

 

substring(triggerBody()?['{Path}'],17,sub(length(triggerBody()?['{Path}']),18))
 
where the substring of the paths starting position of 17 characters is after the "SHARED DOCUMENTS/", and then for the amount of characters is 18 which is the subtraction from the length (which is the 17 from the start plus the final "/" at the end).
 
Cheers,
 
 

View solution in original post

3 REPLIES 3
v-yamao-msft
Community Support
Community Support

Hi @Anonymous,

 

Could you share a screenshot of your flow?

The error message says that the channel id is not in a valid format, I assume that it requires a GUID but not a text name.

I have made following flow for your reference.

Add the trigger When a file is created or modified (properties only) to get the folder path.

Add a Compose action to get the specific channel name:

substring(triggerBody()?['{Path}'],0,sub(length(triggerBody()?['{Path}']),9))

Then list channels from a team.

Add a Condition to check if the Compose output equals to the Channel name.

Under if yes branch, add action Post message. Select dynamic content Channel Id from the previous action.

1.PNG2.PNG 

 

Best regards,

Mabel

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Anonymous
Not applicable

AWESOME Thank You it is Working Perfectly now thanks

 

FYI,

 

Your Compose substring was incorrect, so I used the following:

 

substring(triggerBody()?['{Path}'],17,sub(length(triggerBody()?['{Path}']),18))
 
where the substring of the paths starting position of 17 characters is after the "SHARED DOCUMENTS/", and then for the amount of characters is 18 which is the subtraction from the length (which is the 17 from the start plus the final "/" at the end).
 
Cheers,
 
 

View solution in original post

I am bumbling through trying to send a message to a team via a flow using the information from the 'Get Channel Link'.  Am I correct in thinking that using the substring command you have listed there I can derive the channel correctly to then send a message to that particular channel - mention the channel.  Basically I have a flow that when a message is received in a channel it triggers a flow to send a message to engineers in another channel.  There are about 6 different recipient channels and if I can get this to work for one I will have the ability to have these notifications going all over the place..  perfect for our WFH world.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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
Users online (2,015)