dynamically select team channel to post message to in power automate condition

Christopher Muir 21 Reputation points
2021-01-22T14:29:50.347+00:00

I am trying to set up a flow that posts a message to a particular channel when a form is filled out. The form will specify the channel to post and I want to specify the channel dynamically. I can get it to work if I hard code the channel id, but I want it to post to different channels depending on values in the form.

The image below shows the control. The "Channel id" should be chosen based on a value in the form, the value is the name of the channel, but that will throw an error. Is there a way to dynamically select a channel id here? Is there a specific format or an internal specification or string?

Thanks

59440-channeldynamic.png

Microsoft Teams
Microsoft Teams
A Microsoft customizable chat-based workspace.
9,468 questions
{count} votes

Accepted answer
  1. JimmyYang-MSFT 50,106 Reputation points Microsoft Vendor
    2021-01-25T07:03:30.68+00:00

    Hi @Christopher Muir

    You can try to enter Custom Values in the 'Post a message in a chat or channel' and pass your dynamic values. The following picture shows the result for your reference:

    60114-25.png

    If you don’t know how to get the Channel ID, you can get Teams address in your Teams and channel ID can be seen it. For example:

    URL:
    https://teams.microsoft.com/l/channel/19\*\*\*\*%3a\*\*\*\*3151da3802ea43cd8701a6faf4215978\*\*\*\*%40\*\*\*\*thread.skype/testi?groupId=a4c77160-21b4-4169-a683-5362475cf123&tenantId=1ffaf751-2c9b-46b8-a71b-845cf8b15f69

    Just replace the parts marked strong(%3a, %40) with " : " and " @ " you get a valid channel-ID:

    19:3151da3802ea43cd8701a6faf4215978@thread.skype


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Christopher Muir 21 Reputation points
    2021-01-26T12:30:09.733+00:00

    Thank You. Is there is a documentation reference for this?

    0 comments No comments

  2. Jordan Burcher-Jones 1 Reputation point
    2022-04-05T08:08:24.76+00:00

    Hi @Christopher Muir ,

    To do this dynamically, you could also get a list of available chats using "List group chats". Then look for the chat topic you want to send to and use the chat ID associated with it.

    0 comments No comments