Need assistance copying data in Microsoft Teams? Watch our web seminar “Support & Restore with Microsoft Teams: Whilst Remote!” for expert consultancy.
Searching for additional on Power Apps? Read our latest coverage:
A few several weeks ago, Microsoft added the functionality to transfer contextual information from the host Team or funnel right into a Power Application. This can be a big improvement for citizen developers who’re developing apps to become ingested in a Microsoft Teams context. Apps is now able to produced by having an upfront understanding of in which the application is located, how big the application, client type, theme, and much more. For any full listing of parameters, read my article on creating Teams-aware Power Apps. Once an application is made, it may be exported in the maker portal and imported into Teams to become consumed by users.
Among the challenges that developers may face when developing apps gets Teams context information during development and testing time. As the context-sensitive parameters can be found inside Teams, this information is missing outdoors of Teams. One method to deal with this really is by checking to determine in which the application has been loaded from after which respond accordingly. Here’s how.
Begin with the origin
The easiest method to determine whether the application is launched from inside Teams or otherwise is to check out the source parameter that’s passed in. The parameter might have certainly one of four values:
By searching in the appropriate value, we are able to make choices regarding how to handle specific scenarios.
Use Variable to keep the Parameter Values
Whenever we keep parameter values in variables, we are able to then easily make reference to them without getting to bother with the way we got them. We are able to make use of the following expression in OnStart() to understand how to proceed:
If(source = “teamstab”,
Setting Microsoft Teams Parameters at Runtime
Throughout the building phase, developers have to test their application with all of possible mixtures of input to make certain it’ll become it’s likely to. We are able to expand the instance above not only to determine whether the application has been launched from inside Microsoft Teams or otherwise, but additionally to permit the developer to pick specific input parameters and find out the way the application will behave.
I typically like to setup a Debug panel within my application that’s only visible under specific conditions. Within this scenario, I leverage exactly the same source parameter to find out when the panel ought to be visible or otherwise. So, the OnStart() expression becomes the next:
Set(debug, If(source <> “teamstab”, true,false))
// Preload funnel and team when the data exists
If(source = “teamstab”,
Set(selectedChannel,LookUp(channels,id = Param(“channelId”)))
Within this scenario, I’m activating the debug mode once the source isn’t teamstab (i.e. inside Teams). Then, as opposed to just setting the selectedGroup and selectedChannel variables as ID’s, I’m while using Microsoft Teams connector to retrieve the Teams and funnel information.
The panel itself will be different in line with the use installments of the application, but would typically provide users by having an choice to pick a Team, funnel, along with other settings.
When you are pleased with the answer and wish to check it out, that can be done within the browser after publishing your application. All that you should do is alter the source to teamstab and append the parameters towards the URL within the browser. Within my scenario, I had been using only they and funnel, and so i required to append the groupId and channelId:
(NOTE: don’t get confused through the Microsoft Teams connector. The GetTeam() action requires you to definitely supply the groupId, and not the teamId).
When you deploy an application into Microsoft Teams, any printed updates is going to be visible when the application is reloaded inside a tab. Although this can simplify the testing process for any new application, it’s not ideal when attempting to check changes for an application that already exists and it is getting used being produced.
Developing Teams-aware apps closes the space when one should choose from building it using Power Apps or any other development platforms, for example Node. By using this approach will enable application developers to create modifications and try out an application before with it into Teams, therefore reducing the amount of build-deploy-test-fix cycles needed.