cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Yusha
Advocate V
Advocate V

How to create a private channel in Microsoft Teams using Flow

I easily created a public channel in Microsoft Teams using Flow and using the Teams connector / action.

How can I create a private channel though using flow? Is this possible?

1 ACCEPTED SOLUTION

Accepted Solutions
RobElliott
Super User
Super User

Hi @Yusha, it's not yet possible to create a private channel with Power Automate, you need to do it in the Teams site itself. This is not really surprising as private channels have only been released recently and it takes time for flow actions to catch up.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

17 REPLIES 17
RobElliott
Super User
Super User

Hi @Yusha, it's not yet possible to create a private channel with Power Automate, you need to do it in the Teams site itself. This is not really surprising as private channels have only been released recently and it takes time for flow actions to catch up.

Rob
Los Gallardos
If I've answered your question or solved your problem, please mark this question as answered. This helps others who have the same question find a solution quickly via the forum search. If you liked my response, please consider giving it a thumbs up. Thanks.

View solution in original post

Hi Rob,

Has this improvement been submitted anywhere? I want to either submit it as an idea or I want to track the progress on this so I can be notified when Flow supports creating private Team Channels..

 

Thanks in advance

You can add it to the ideas at https://powerusers.microsoft.com/t5/Power-Automate-Ideas/idb-p/FlowIdeas for others to vote on.

Rob
Los Gallardos

Hi @RobElliott , do you know if is it going to be possible and when?

 

Thank You!

Masoud9

AndrewCitera
Frequent Visitor

Any update on when this feature will be released?

It appears that you can achieve this by calling the Office Graph API (HTTP requests is a premium feature in Power Automate), this is possible from Azure Logic Apps too.

Review: https://myteamsday.com/2020/01/03/create-private-channel-graph-api/

@jvdlinden Unfortunately 'HTTP Requests' are a premium feature of Power Automate, so this isn't really a valid solution. Did you actually try the solution that you linked? I think, at one point, I did try it - and it did not work. Also note that the Microsoft employee above confirmed that they do not support this in Power Automate, he didn't mention the premium feature.

@Yushathanks for your reply.

Short answer: no.

I am about to try this feature out in the upcoming days because I really need the private channel to be created automatically.

I disagree about your remark, premium features are actually solutions... The question is: cost vs benefits? 

I will update the thread once I know if it really technically works.

I have tested out the Office Graph approach. It actually does work.

The user performing the HTTP POST will also be the owner of the Private Channel. You'll need to provide additional owners in the body if required.

@jvdlinden  Hey, do you mind sharing the export .zip file of the flow that you have created. ? It will really help.. thanks.

Hello @P_SA ,

 

Unfortunately I cannot provide a ZIP, but I will try as best I can to help you out.

 

On beforehand, please note that this feature uses the Microsoft Graph beta endpoint, which should not be used for production applications because they are subject to change.

Please review https://docs.microsoft.com/en-us/graph/api/overview?view=graph-rest-beta for additional details.

 

Now follow these steps: https://docs.microsoft.com/en-us/graph/auth-v2-service

This will explain how to (1) register your app in Azure AD, (2) how to configure the appropriate permissions for Microsoft Graph, (3) how to provide admin consent for the application (the global admin can also navigate to Azure AD, open your app registration and provide consent), (4) obtain an access token from Microsoft Graph and (5) how to call the Microsoft Graph using the access token.

 

How this looks like from my Azure Logic Apps, please review the screenshots below:

Use the HTTP action to call Microsoft Graph for an access token

1- obtain access token.png

red values are obtained from your app registration and after generating a client secret (there may be better ways to increase security for these types of calls)

 

Use "Parse JSON" action to parse the JSON payload coming back (response), simply use the blue link "Use sample payload to generate schema":

2- parse access token response.png

Or use the schema below:

{
    "properties": {
        "access_token": {
            "type": "string"
        },
        "expires_in": {
            "type": "integer"
        },
        "ext_expires_in": {
            "type": "integer"
        },
        "refresh_token": {
            "type": "string"
        },
        "token_type": {
            "type": "string"
        }
    },
    "type": "object"
}

 

Now you have the access token, I am retrieving a user profile details from "Office 365 Users" to obtain the user id by providing the email address of the user:

3- get O365 user profile.png

 

Finally I am calling the Microsoft Graph beta endpoint to actually add the private channel:

4- create private channel (first part).png

Provide the Office 365 Group ID, here I am using a dynamic value.

Make sure there is one (1) white space between token_type and access_token

Provide the body JSON object, here I am adding two individual users as an owner to the private channel.

5- create private channel (second part).png

 

Hope this helps.

trashanger
New Member

Hi,

 

So there's no other way than having an app in Azure AD ?

 

Thanks,

@trashanger - just to clarify a bit.

My original question was 

How can I create a private Teams channel using the Teams Connector in Power Automate

 

Microsoft replied; at this time that is not supported

 

@jvdlinden  pointed out that though it is not supported, it definitely can  be done using HTTP Request module in Power Automate. Unfortunately this requires three things;

1) Admin access to Microsoft Graph API for your org

2) Using a API that is in a BETA version (be scared for your jobs that run in a production environment)

3) Knowledge of building HTTP requests / receiving them etc

 

So - we chose personally not to proceed forward until Microsoft makes this feature available through the Teams connector in Power Automate. If this is a must have requirement though, I would suggest following @jvdlinden solution.

What about accessing private channels from Flows? It appears all I can see is General.

Hi @reatonfbcs what do you mean with "accessing private channels"?

What do you want to achieve? Get a list of Private channels associated with a team?

VN
New Member

Yusha, i agree with @RobElliott , however it is possible to create custom connector and create private channel using graph API. Main difference is you have to define membership type as private and add members to it.

Post request example is here:

https://docs.microsoft.com/en-us/graph/api/channel-post?view=graph-rest-1.0&tabs=http

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 (1,980)