SOLVED

Add app to team after it was added to personal scope

Copper Contributor

Hi,

Our app needs teams scope without which it is useless. However personal scope is also needed to show installation steps and then show some stats in tabs. So in app store our app provides two options: "Add" and "Add to a team". 

 

(NB: I use Node JS Botbuilder SDK)

 

When added to a team, the installation flow is more or less clear: onInstallationUpdateAdd checks if 

conversationType === 'channel' and in that case creates all DB records and sends Welcome message to selected channel for all users to see.
 
However when Add button is clicked, bot is unable to post to a channel (I prompt user to select a team and then create a custom channel in that team), since it's out of the roster. In such case I proactively install app to selected team via graphClient.
 
Is this a preferred flow or am I overcomplicating things? 
3 Replies

@dmsaprykin - In ideal scenario, if we add "personal" scope for your app/bot in manifest, so while installing the bot it will show "Add"  button and on click on it, it always install the app/bot in personal scope.

If you want to install the bot/tab in teams channel, we should add scope as 'team' in manifest & while installing the bot/tab, it will show you the "Add To Team" button with channel selection.

Also, scopes are different for different capability like:

staticTabs => Currently, static tabs support only the personal scope, which means it can be provisioned only as part of the personal experience.
Manifest schema reference - Teams | Microsoft Docs

bots => Specifies whether the bot offers an experience in the context of a channel in a team, in a group chat (groupchat), or an experience scoped to an individual user alone (personal). These options are non-exclusive.
Manifest schema reference - Teams | Microsoft Docs

configurableTabs => Currently, configurable tabs support only the team and groupchat scopes.
Manifest schema reference - Teams | Microsoft Docs

Thanks, 

Chetan Sharma

---------------------------------------------------------------------------------------------------------

If the response is helpful, please click "**Mark as Best Response**" and like it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate. 

Thank you Chetan,
That's the problem, I need static tabs and teams/personal bot. Personal bot more for welcoming user and onboarding experience. So either Add or Add to teams can be clicked, but since our bot doesn't make sense without a team, I have to proactively install (if not installed previously) to a team user selects during onboarding chat. And I wonder if that's acceptable solution.

Main issue is when user clicks Add to team, I receive two installation events, personal first and channel second. In that case I send user a message — you're all set, bot is team A, channel B. But if Add button is clicked, I receive only one event and need to set some kind of timeout when I check if bot is not in the team so I send different onboarding flow.

Just trying to understand that that's the only option for my scenario.
best response confirmed by dmsaprykin (Copper Contributor)
Solution
@dmsaprykin - These are the ideal scenarios and yes, we need to handle the bot installation event and need to check the condition for conversation type = "Personal" or "Team" and take a decision to send the card in personal or Teams scope accordingly.
1 best response

Accepted Solutions
best response confirmed by dmsaprykin (Copper Contributor)
Solution
@dmsaprykin - These are the ideal scenarios and yes, we need to handle the bot installation event and need to check the condition for conversation type = "Personal" or "Team" and take a decision to send the card in personal or Teams scope accordingly.

View solution in original post