How to add another Team as a member in a new Team's Channel - Power Automate - microsoft-teams

I am trying to create a flow in Power Automate that creates a Teams channel, then adds members to the newly created team. In Microsoft Teams, you are able to add a Channel as a "member", so that anyone who had permissions in the other channel would have the same permissions in the new channel (as I understand it).
I am trying to do the same thing in Power Automate, but I am having troubles figuring out how to add a Channel as a member, rather than just specific people.
The reason for this, is instead of deleting people 1 by 1, I want to be able to use a template Channel, and if I remove one person from the template, they lose access to all other channels.
This is my workflow so far:
I am using the input from ChannelID directly from Teams. (Clicking the "...", Get Link to Team, and copying code after URL).
I am getting an error stating that it does not exist. How can I go about fixing this?
Any and all help is greatly appreciated!

Related

Can I create a configuration page for a Teams bot app?

I'm building my first Teams app which will have two primary functions:
Proactively send a message to the channel (the bot is installed into) when a specific event occurs on my backend.
Members of the channel reacts to the message via actions.
I finally have a pretty good idea of how to set this up (I think) - but one part I'm missing is that in order to identify the specific app installation as belonging to one of my customers, I need to be able to allow the installing user to supply extra information like e.g. an API-key so that I can associate the specific channel with my specific customer.
Is there any way of doing this with a bot app? I've found examples for creating a configuration page, but they all seem to be associated with tab apps?
I could of cource have the bot ask the user for the information - but maybe there's a "cleaner" way?
Any examples or tutorials would be greatly appreciated as I find it rather hard to get stuff working using Microsoft's own examples etc. :)
Thanks a lot!
When you receive any message from the user, either by typing to your bot, or even installing it into a channel, group chat, or personal context (where you get the conversationUpdate event), you are able to get specific details off of the activity object. If the user sends a message, for instance, then the text property on the activity object will have a value. Incidentally, this is the same activity you will use to get the conversation details you need for the Proactive message.
With regards your question, the activity class also includes a tenantId property, hanging off the conversation property. This is the unique Microsoft 365 Id for the tenant, which would be what I'd suggest to uniquely identify them for your API, or licensing, or similar.

Creating a Private Channel via Graph API Is Creating a Standard (not Private) Channel

I am creating a new Team using Graph (DotNet SDK) but when I try create a Private channel, it's creating it as a Standard (shared) Channel. Code is similar to the following:
newTeam.Channels.Add(new Channel
{
DisplayName = "Test Private Channel",
IsFavoriteByDefault = true,
Description = "Test",
MembershipType = ChannelMembershipType.Private
});
Am I doing something wrong? Is there perhaps a bug in the SDK?
Update: I should mention this is being specified at the time of creating the Team itself, using this endpoint.
So this is possible to achieve, with a workaround. When creating the Channel as part of the initial Teams creation, as described in the original question, it will ONLY create Channels as "Standard" Channels, even if they are specified as Private. If you definitely need the Channel(s) to be private, you need to create them separately, AFTER creating the Team, using the Create Channel endpoint.
As an important follow up, even though you might have just created the Team, and have Team.Create permissions, you will ALSO need Channel.Create or similar to immediately create the new channel straight after.
To an MS team members following this thread, I'd like to report the following issues, in summary:
It's not possible to create Private channels using standard OOB Templating in Teams - this should be added
It's not possible to create Private channels using the Create Team endpoint - setting the MembershipType to Private is simply ignored - this would appear to me to be a bug
I would suggest that if my application has the rights to Team.Create, where I can create channels (just not Private ones), that should be a sufficient permission already without needing Channel.Create

How to perform certain actions after a Slack workspace's admin approves the installation of the app?

Edit: I'm using Django and inside the DjangoInstallationStore.save method I create a channel, join the bot to it, and post a message into the channel.
It seems that if a user attempts to install the app to a workspace where there might be admin restrictions, the installation and bot are created but the channel cannot be created (restricted_action) or joined (channel_not_found ) and the members of the channel cannot be viewed (channel_not_found).
I'm investigating if I have a bug in my code but also wonder if there is anything I missed about Slack API as to if certain restrictions in the workspace could cause such scenarios to happen? Cheers.

MS Teams Outgoing Webhook Without Mention Possible?

I'm trying to create a subscription to receive the contents of all new messages sent within a private Team, and so far it appears I have to configure a bot / webhook within Teams (and only messages #mentioned to that bot / webhook will be sent to me), or otherwise use the Graphs API (I can't determine whether the same caveat exists with #mentions).
The use case is to allow members of the Team to post messages, and for my listening application to consume the message contents and take an action (turn on a light, etc.. but external to Teams). I don't anticipate needing to write anything back into the Team.
I found this link in another post: https://blog.thoughtstuff.co.uk/2020/01/how-to-use-the-new-webhooks-for-microsoft-teams-channel-chat-messages/
Has anyone successfully been able to subscribe to all messages within a private team for a similar use case?
Thank you!
Posting the Answer for better knowledge
Copying from #Sridevi comments
To track messages and replies in a channel, you can create a change notification subscription at a channel level. Please follow this documentation.

Add member to list of channels in slack

Is there a way to add a user/member to a list of a hundred or more (existing) slack channels automatically? Perhaps a slack bot, however, I am unable to find any examples of this that don't require listening for new channel creation events.
Every few weeks I need to add a few people to an assortment of channels. Surely the folks at Slack could add a UI screen to allow one to specify the person or persons and then check all the channels that they should be added to.
It's soooooo time consuming to add them now!
I found using the /invite command saves quite a few clicks. I copied the below command and then I could paste it into each channel and press enter -> done.
For open channels its instant. For locked channels you need a click to do final grant.
Still this was much faster than before
/invite #johndoe
Found a No script, no extensions solution:
Type the /who command on a channel you want to add.
Copy the output
Paste it in the channel where you want those people to get invited to
Press Intro/Enter key
Slack will ask all those people "that are not in the channel yet". Press the Invite button you'll get list of members invited.

Resources