web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create a label - join ...
Power Apps
Answered

Create a label - join a Team on Teams

(0) ShareShare
ReportReport
Posted on by 909

Hello,

 

I am interested in connector of Teams.

I wanna add a button/label Join Team for latest information.

So If user click it it will make him join a team.

 

I encountered a lot of problems.

For example this button issue:

MicrosoftTeams.AddMemberToTeam(19%3acb3abc314113219dcd441da7eabfd65213124c3f7%40thread.tacv2/Og%25C3%25B3lny&,gblUserEmail)

OnStart:

Set(gblUserEmail,User().Email)

 This shows about 30 errors.

I also do not know how to check if user is already a member to prevent errors.

 

I have problems in estabilishing groupid,teamid,userid for other Teams functions.

I've read a guide but still I am green as newborn baby diaper.

Categories:
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Elitezone ,

     

    Do you want to let app user add itself into a particular Teams team through a button if it is not already in the team?

     

    If you do, as per you have already know the syntax of MicrosoftTeams.AddMemberToTeam() and used a variable to store user Email, the formula would be like below:

     

    If(IsBlank(LookUp(Office365Groups.ListGroupMembers(teamId).value,mail=gblUserEmail)),MicrosoftTeams.AddMemberToTeam(teamId,gblUserEmail))

     

    For your further questions, if you want to retrieve other information of a particular team or group, you could use several connectors of MicrosoftTeams, Office365Groups, Office365Users and Azure AD etc. As you have seen in the formula above I have used Office365Groups to list all members in a group which is also a team in Teams. Please reference below official doc to know more about O365 group and Teams team:

    https://docs.microsoft.com/en-us/microsoftteams/office-365-groups

     

    So if you want to get team id of Teams or group id of O365, you could use the formula:

     

    LookUp(Office365Groups.ListOwnedGroupsV3().value,displayName="group name").id
    OR 
    LookUp(MicrosoftTeams.GetAllTeams().value,displayName="team name").id

     

    and user id:

     

    AzureAD.GetUser(gblUserEmail).id

     

    Usually these connectors support using a User Principle Name (UPN) the same as the user ID.

     

    Hope this helps.

     

    Best regards,
    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 405 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 368

#3
WarrenBelz Profile Picture

WarrenBelz 244 Most Valuable Professional

Last 30 days Overall leaderboard