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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Create a Team from a G...
Power Automate
Answered

Create a Team from a Group using a Teams Template

(0) ShareShare
ReportReport
Posted on by 40

Trying to combine the approaches for creating a team from a group:

https://learn.microsoft.com/en-us/graph/api/team-put-teams?view=graph-rest-1.0&tabs=http

and creating a team from scratch:

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

to be able to create a team from a group, but set the Teams Template, and create a number of Tabs in the General channel.

 

I need to create the Group first, because I need the Shared Mailbox for the team to remain visible to email clients (and there does not seem to be anyway to set it to Visible after creating the team from scratch.  This task seems possible in Power Shell and Azure Automations but not Power Automate.

 

Since the doco for converting a team to a group says the body of the request should be JSON representation of a Team and the examples of this used in the doco for creating the team from scratch (using POST) include Templates and Tabs (and I have been able to get these to work when creating the team from scratch, I was hopeful that I could include similar synax in the Body of the PUT.  

 

I am using the Premium HTTP connector for this.

 

So as a relatively simple example, in POST the following works:

{

   "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('@{variables('TeamTemplateID')}')",

   "displayName": "@{variables('TeamShortName')}",

   "description": "@{variables('TeamDescription')}",

    "channels": [

        {

            "displayName": "General",

            "isFavoriteByDefault": true,

            "description": "This is the main channel for storing documents in the Files section",

            "tabs": [

                {

                    "teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",

                    "displayName": "Project eMail",

                    "configuration": {

                        "contentUrl": "https://outlook.office.com/mail/group/[URL Masked]/@{variables('TeamEmail')}/email/inbox"

                    }

                },

                {

                    "teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",

                    "displayName": "Project Register",

                    "configuration": {

                        "contentUrl": "https://[URL Masked]/DispForm.aspx?ID=@{variables('ProjectRegisterID')}"

                    }

                },

                {

                    "teamsApp@odata.bind": "https://graph.microsoft.com/v1.0/appCatalogs/teamsApps('com.microsoft.teamspace.tab.web')",

                    "displayName": "Opportunity Register",

                    "configuration": {

                        "contentUrl": "https://[URL Masked]/DispForm.aspx?ID=@{variables('OppRegisterID')}"

                    }

                }

            ]

        }

    ]

}

But this in PUT does not:

   "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('@{variables('TeamTemplateID')}')",

   "memberSettings": {

    "allowCreatePrivateChannels": true,

    "allowDeleteChannels":false,

    "allowAddRemoveApps":true,

    "allowCreateUpdateChannels": true

  },

  "guestSettings":{

    "allowCreateUpdateChannels": false,

    "allowDeleteChannels":false,

    "allowAddRemoveApps":false

  },

  "messagingSettings": {

    "allowUserEditMessages": true,

    "allowUserDeleteMessages": true

  },

  "funSettings": {

    "allowGiphy": true,

    "giphyContentRating": "strict"

  }

}

 

It seems that when ever I include @OData.bind lines in the body for the PUT method (used in converting the Group to a Team) I run into errors like this:

{
  "error": {
    "code": "BadRequest",
    "message": "Could not find member 'template@odata.bind' on object of type 'Team'. Path '['template@odata.bind']', line 1, position 446.,Could not find member 'template@odata.bind' on object of type 'Team'. Path '['template@odata.bind']', line 1, position 550.",
    "innerError": {
      "message": "Could not find member 'template@odata.bind' on object of type 'Team'. Path '['template@odata.bind']', line 1, position 446.,Could not find member 'template@odata.bind' on object of type 'Team'. Path '['template@odata.bind']', line 1, position 550.",
      "code": "InvalidRequest",
      "innerError": {},
      "date": "2023-09-14T10:08:31",
      "request-id": "bf022aa3-b94c-4c96-938a-9a0263155290",
      "client-request-id": "bf022aa3-b94c-4c96-938a-9a0263155290"
    }
  }
}

 

I have seen suggestions about adding @OData.type: null, and using two @'s but neither of these seem to work.   Does anyone have any idea how to solve this?

 

As an alternative, I did try to use the Teams connector to do the Tabs, but that doesn't seem possible.

 

Its probably achievable to use the PUT to add Apps and Tabs, but it would be some much better for long term flexibility if what is in the template could be used when creating the Team from the Group.

 

Thanks for reading this far....

Categories:
I have the same question (0)
  • Verified answer
    tas_ranson Profile Picture
    40 on at

    I think I may have found part of the answer at least here:

    https://learn.microsoft.com/en-us/graph/teams-create-group-and-team

     

    In this version they use a POST to the Teams end point, with this body:

    {
    "template@odata.bind": "https://graph.microsoft.com/v1.0/teamsTemplates('@{variables('TeamTemplateID')}')",
    "group@odata.bind": "https://graph.microsoft.com/v1.0/groups('@{variables('TeamID')}')"
    }

     

    And doing this seems to work to invoke the template.   Now on to tweaking the Tabs from the template and other myriad of things to get the team properly configured.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard