cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Auto Create Folders and Files when a new teams site is created using files from an existing teams site as a template and also how to send a teams message when new team member added Power Automate

Hi All, (@MarconettiMarco @Expiscornovus @Pstork1 @Hardesh15 @ScottShearer ) 

Looking for some Power Automate advice/ help please - done some digging on the forum and found a similar thread: Solved: Re: How to auto-create Folders & Files when a Chan... - Power Platform Community (microsoft....

However I'm running into various errors from ""The response is not in a JSON format" etc

 

Background:

 

Essentially I'm trying to get a set of folders (a list of folders to be in every team - a "template" from an existing teams/sharepoint site) uploaded to every new teams site (New Team Id) (after adding new team members also) that's created by this Power Automate flow which is trigged when an email is received to create it.

 

From my research I've established that the "General" folder/ channel of a new Teams site is not generated automatically unless the "Files" tab in Teams/SharePoint is manually selected to trigger it's creation -I may be wrong here so happy to be corrected.

 

So far I've attempted to do a "create file" action to create a blank creation word doc to trigger this general folder creation and then after that I'm trying to do a "Copy folder" action to copy the folders from a Template Teams Site I created as I want to replicate these on every new teams site that is triggered automatically from earlier in the flow from teamID.

PowerPotential_1-1662987477439.png


Please see screenshot and any guidance would be appreciated.

Also, as part of the earlier "add a member to a team" that is performed before the folder actions - I'd like to send a welcome post on teams to the person that's just been added to the new team but I've noticed that I can't get their details from "Get User profile (V2)" as I want this to be able to identify them and then to trigger "post a message to channel" when they are added?

PowerPotential_0-1662987320243.png

Thanks for your time and help everyone! 😊

12 REPLIES 12
JimmyWork
Memorable Member
Memorable Member

@PowerPotential I have not fully looked into your details but this worked before to trigger the sync for the teams files tab.

 

Simply create a folder named General.

 

 

@JimmyWork Hey, thanks for the reply.

 

These new teams are auto generated by the flow with a unique name from the email  each time an email is received - as above I initially tried the  the option of creating a dummy text word document to trigger the generation of  the “General” folder as the path  - as screenshot above shows but it fails.

 

I’m still a new user so if you could check over my full post please to see the background as this may give additional context and would be appreciative of further advice.

 

Thank You.

@tom_riha - Hi Tom - seen your reply to "Teams folder not appearing until 'Files' tab is clicked" - could you have a look at my issue detailed above please and add any comments also - you mentioned "scripting" in your response but could you elaborate please as I wasn't sure as still new to PowerAutomate and really need some assistance with this for you or any forum users that could assist- many thanks!😀

That's because there are no folder named General yet.

Please create the folder named General this will trigger the sync between the folder and teams channel.

Thanks for the reply @JimmyWork - can you please give me guidance/steps on how I actually do that as this needs to be done for each new team that is autogenerated by the flow above.  And can you also shed any further light on point two above regarding the get user profile pet that’s in the second screenshot in my first post above, please? Thanks!

In your flow after the team is created you get the SharePoint site URL from that team.

You then use action "Create new folder" and use the URL from the Team you just created, name the folder "General"

 

JimmyWork_0-1663072002710.png

 

 

I don't know how your flow looks for creating a Team, but here is one option of getting the Teams SharePoint URL.
https://normyoung.ca/2020/12/03/use-power-automate-to-get-a-ms-teams-sharepoint-url/

 

This should or at least before it did trigger the sync between the channel and the folder and will mimic when you manually click the files tab in the Team.

Hi @JimmyWork,

Please excuse the delay in my reply, I followed your advice and the instructions on the link you provided but I couldn't access Graph API connection nor was able to access Azure Active Directory due to not having the correct permissions and none of the additional steps worked in getting the SharePoint url you mentioned.

I've included the entire flow (numbered in order) in the pictures below - please also see my flow background above and in this reply and what I'm trying to also achieve with this:

 

Flow Background – Current Use:

  1. I regularly received a standardised e-mail template when being allocated a project.
  2. The flow picks up on the title after the dash (-) in this email - “GetName” uses this as the New Teams Name (as seen an image 2).
  3. Simultaneously it is also saving the attachments from the email that’s been received directly to OneDrive in a new folder of the same name as produced by “GetName” and that works without any issues. (image2)
  4. When the New Team Site is created it creates additional channels as listed in image 2 and also creates the General channel by default.
  5. After all the channels are created - image 3 -all of the email addresses from the “To” field in the original e-mail in step 1 are added to the New Team Site via “Apply to Each” (excluding myself via “Remove My Email” so the flow doesn’t fail) and an email is sent to me to confirm everything has been set up successfully. - All Credit to @MarconettiMarco for assisting with this!

What I am looking to achieve:

  1. Templated Folders Created in Specific Channels with email attachment upload:
    When each team is created (Dynamically) I’m looking for a standard templated set of folders to be created and uploaded to the Teams “Files” tab of that channel/the linked SharePoint site for that team and would like to include the attachment from image 2 to also be uploaded to a specific folder within a specific channel where possible. Again, from your post above, I tried following your instructions regarding getting the Teams SharePoint URL and create new folder, but this hasn’t worked sadly – I’m open to any further assistance/suggestions.

  2. Standard Welcome Message Posted in the General Channel of the newly created Team:
    I’d like to be able to post a standard welcome message from me to each new member that is added to the New Team from the "apply to each" in Image 2 – I’ve tried both the “Get User Profile O365” option and “Post message in a chat or channel” but these fail as they don’t recognise the General channel. I event tried a new flow with a teams trigger of "When a new team member is added" but I couldn't get the flows to communicate.

  3. Creation of New “OneNote Notebook” on each New Team Creation:
    This to be created and stored to OneDrive for business folder that’s created with the Teams Site Name from “GetName” image 2 - I can only see the option to create a new page in a section not a new workbook.

  4. Creation of a New “Planner” from template or from scratch:
    Again, this would be on each new dynamic Teams creation – saved to a specific channel created earlier in the flow allowing the assigning of tasks to those that have been added to the team earlier in the flow. Options listed are requiring Groupid/planner path and I'm unable to populate this.

1)

PowerPotential_1-1663504827720.png

2)

PowerPotential_2-1663504845410.png

3)

PowerPotential_3-1663504877341.png


As mentioned previously I'm new to  PowerAutomate  - before typing this reply I've tried YouTube for any similar solutions to try on my own first including the help documentation provided by Microsoft with no luck -

@MarconettiMarco  @Expiscornovus @Pstork1 @Hardesh15 @ScottShearer @tom_riha  - I would also very much appreciate any additional views/advice/options you could also provide from your experience on the above thread too?

Thank You All.



Hi @JimmyWork@MarconettiMarco , @Expiscornovus@Pstork1 , @Hardesh15 , @ScottShearer@tom_riha 

 

Further Update points to last message:

Sorry, I couldn't edit my last reply message above to include this additional information below due to a formatting issue when posting it but wanted to include the additional points below:

What I am looking to achieve:

  1. Templated Folders Created in Specific Channels with email attachment upload:
    When each team is created (Dynamically) I’m looking for a standard templated set of folders to be created and uploaded to the Teams “Files” tab of that channel/the linked SharePoint site for that team and would like to include the attachment from image 2 to also be uploaded to a specific folder within a specific channel where possible - see point 5 below also. Again, from your post above, I tried following your instructions regarding getting the Teams SharePoint URL and create new folder, but this hasn’t worked sadly – I’m open to any further assistance/suggestions.
  2. Standard Welcome Message Posted in the General Channel of the newly created Team:
    I’d like to be able to post a standard welcome message from me to each new member that is added to the New Team from the "apply to each" in Image 2 – I’ve tried both the “Get User Profile O365” option and “Post message in a chat or channel” but these fail as they don’t recognise the General channel. I even tried a new flow with a teams trigger of "When a new team member is added" but I couldn't get the flows to communicate.  I'd also like to be able to have the same welcome message applied to every new team member that's added to every newly team going forward and to any existing teams that this flow has created when new members are added at any point in the team’s existence - I'm unsure how to achieve this or if it's even possible?
  3. Creation of New “OneNote Notebook” on each New Team Creation:
    This to be created and stored to OneDrive for business folder that’s created with the Teams Site Name from “GetName” image 2 - I can only see the option to create a new page in a section not a new workbook.
  4. Creation of a New “Planner” from template or from scratch:
    Again, this would be on each new dynamic Teams creation every time the flow is run– saved to a specific channel created earlier in the flow allowing the assigning of tasks to those that have been added to the team earlier in the flow. Options listed are requiring Groupid/planner path and I'm unable to populate this.
  5. Update of PowerPoint Title Slide and File Name (from the original email attachment received):
    The PowerPoint attachment that is saved to OneDrive for Business from point 3 in Flow Background details above, is received as a standard "template" presentation that I currently have to manually amend a pre-defined text box on the tile slide (slide1) and change the actual saved file name to match/reflect the project name so it matches that taken from "Get Name" above, is there away to automate this to be pre-filled/saved with the name taken from "GetName" above so essentially the New Teams Name, OneDrive Folder that's created and this attachment are all the same every time this flow is run as it's automated cloud flow? is this possible?

Thank you all again for your time with this!

This is a very complex flow and will be difficult to achieve.  But here are some responses to your points

1)  The only way to truly get the URL for the SharePoint site created behind the Team is to use Microsoft Graph.  This is not a simple operation and most beginners with Power Automate find it very difficult.  this post in the Tech Community has an answer that discusses the MS Graph call that would be necessary.

1b) I have created a set of folders and files in a site using a template.  The problem is that Power Automate doesn't have a recurrence capability.  so the only reliable way I have found to do this is create the files and folders I want to use as a template in a .Zip archive.  I can then extract the whole archive to the location.  Please note that empty files and empty folders in the archive will be ignored.

2) It takes a few minutes for the team to be created so you'll either need a delay or a loop doing a Get team check to make sure the team exists before proceeding.  But once you know its there then there is an action that can be used to Post a message to a channel.

3) Again the answer is to use MS Graph.  There are calls in Graph to create a OneNote Notebook.

4) There is an action taht will let you create a Planner site.  You would then need to add it as a Tab in Teams

5) I'm not aware of any connector in Power Automate that can work with Power Point. 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Just to give you an idea.  I was able to build a flow that does the first few things you requested.  Screenshots below.  It does use MS Graph to get the URL of the SharePoint site.  Mine starts with a manual trigger, but an email trigger would work to.  

 

Create a variable to hold the connection information for MS Graph and a variable to control the loop while waiting for the team to be built.

image.png

Parse the connection information variable to gain access to the individual values and then create the new team.

image.png

Use a Do Until loop to pause until the Team is created and can be retrieved.

image.png

Use the ID from the Team to get Information about the Microsoft 365 group used in the Team. Then use the ID of the M365 Group in MS Graph to get the SharePoint URL associated with that Group.  That is the SharePoint site for the Team.

image.png

Parse the results to get access to the URL itself. Then split it on /Shared Documents to get just the URL of the SharePoint site.

image.png

use outputs('Compose')[0] as the Site URL and Create a General folder in the Documents library of the site. Then create one or more files in the General folder. 

image.png



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi, @Pstork1  Thank you for your time and very detailed reply.

Sadly due to the secured nature of our Environment set up by Admin - we don't have access to use Graph - it's even switched off on SharePoint "You're seeing a limited version of this page because Office Graph is turned off." - I've tried to get assistance to get access but I've been told it's not an option.

 

I was wondering if there was a work around of maybe saving the attachment to a specific Teams "Template" site first that I could create and then be able to copy the folders/files from this template to one of the other defined Channels (not the General channel) from the flow above that then gets created and established each time the flow is run? A Teams/ Sharepoint to Sharepoint copy function, if that's possible?

If it's possible, any guidance would also be appreciated here!


Thank You.

Sorry, but there is no way to do what you are requesting using Teams without using MS Graph.  As has been pointed out the channel folder isn't created in teams until someone clicks on the Files tab in the Teams client.  So you need to get the url of the SharePoint site associated with the team and create the folder manually.  MS Graph is the only way to do that.  There are ways to provision a Teams environment using Power Shell. That might provide an option. But that won't use Power Automate.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

Announcements

Power Platform Connections - Episode 6 | March 23, 2023

Episode Six of Power Platform Connections sees David Warner and Hugo Bernier talk to talk to Business Applications MVP Shane Young, alongside the latest news, product updates, and community blogs.    Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show!        Show schedule in this episode:  0:00 Cold Open 00:24 Show Intro 01:02 Shane Young Interview 22:00 Blogs & Articles 22:20 Integrate FullCalendar.io with Power Pages 23:50 Text Data 25:15 Zero to Hero Power Apps Saga 25:44 Parent Hub Association 26:33 Using Custom Values for OneNote Power Automate References​ 28:04 ​Dynamics Power Israel 28:44 Create Beautiful Canvas Apps in Dataverse for Teams ​ 30:36 Outro & Bloopers  Check out the blogs and articles featured in this week’s episode:   https://francomusso.com/integrate-fullcalendar-io-with-power-pages-from-json-basics-to-advanced-outp... @crmbizcoach https://yerawizardcat.com/text/ @YerAWizardCat www.fromzerotoheroes.com/mentorship ​ @thevictordantas https://www.expiscornovus.com/2023/03/16/parent-hub-association/ ​ @Expiscornovus https://lindsaytshelton.com/2023/03/15/the-painful-process-of-custom-values-for-onenote-power-automa... @lshelton_Tech https://never-stop-learning.de/create-beautiful-canvas-apps-in-dataverse-for-teams/ @MMe2K    Action requested: Feel free to provide feedback on how we can make our community more inclusive and diverse.  This episode premiered live on our YouTube at 12pm PST on Thursday 23rd March 2023.  Video series available at Power Platform Community YouTube channel.    Upcoming events:  Business Applications Launch – April 4th – Free and Virtual! M365 Conference - May 1-5th - Las Vegas Power Apps Developers Summit – May 19-20th - London European Power Platform conference – Jun. 20-22nd - Dublin Microsoft Power Platform Conference – Oct. 3-5th - Las Vegas  Join our Communities:  Power Apps Community Power Automate Community Power Virtual Agents Community Power Pages Community  If you’d like to hear from a specific community member in an upcoming recording and/or have specific questions for the Power Platform Connections team, please let us know. We will do our best to address all your requests or questions.   

Announcing | Super Users - 2023 Season 1

Super Users – 2023 Season 1    We are excited to kick off the Power Users Super User Program for 2023 - Season 1.  The Power Platform Super Users have done an amazing job in keeping the Power Platform communities helpful, accurate and responsive. We would like to send these amazing folks a big THANK YOU for their efforts.      Super User Season 1 | Contributions July 1, 2022 – December 31, 2022  Super User Season 2 | Contributions January 1, 2023 – June 30, 2023    Curious what a Super User is? Super Users are especially active community members who are eager to help others with their community questions. There are 2 Super User seasons in a year, and we monitor the community for new potential Super Users at the end of each season. Super Users are recognized in the community with both a rank name and icon next to their username, and a seasonal badge on their profile.    Power Apps  Power Automate  Power Virtual Agents  Power Pages  Pstork1*  Pstork1*  Pstork1*  OliverRodrigues  BCBuizer  Expiscornovus*  Expiscornovus*  ragavanrajan  AhmedSalih  grantjenkins  renatoromao    Mira_Ghaly*  Mira_Ghaly*      Sundeep_Malik*  Sundeep_Malik*      SudeepGhatakNZ*  SudeepGhatakNZ*      StretchFredrik*  StretchFredrik*      365-Assist*  365-Assist*      cha_cha  ekarim2020      timl  Hardesh15      iAm_ManCat  annajhaveri      SebS  Rhiassuring      LaurensM  abm      TheRobRush  Ankesh_49      WiZey  lbendlin      Nogueira1306  Kaif_Siddique      victorcp  RobElliott      dpoggemann  srduval      SBax  CFernandes      Roverandom  schwibach      Akser  CraigStewart      PowerRanger  MichaelAnnis      subsguts  David_MA      EricRegnier  edgonzales      zmansuri  GeorgiosG      ChrisPiasecki  ryule      AmDev  fchopo      phipps0218  tom_riha      theapurva  takolota     Akash17  momlo     BCLS776  Shuvam-rpa     rampprakash   ScottShearer     Rusk   ChristianAbata     cchannon   Koen5     a33ik        AaronKnox        Matren        Alex_10        Jeff_Thorpe        poweractivate        Ramole        DianaBirkelbach        DavidZoon        AJ_Z        PriyankaGeethik        BrianS        StalinPonnusamy        HamidBee        CNT        Anonymous_Hippo        Anchov        KeithAtherton        alaabitar        Tolu_Victor        KRider        sperry1625        IPC_ahaas      zuurg     rubin_boer     cwebb365       If an * is at the end of a user's name this means they are a Multi Super User, in more than one community. Please note this is not the final list, as we are pending a few acceptances.  Once they are received the list will be updated. 

Microsoft Power Platform | March 2023 Newsletter

Welcome to our March 2023 Newsletter, where we'll be highlighting the great work of our members within our Biz Apps communities, alongside the latest news, video releases, and upcoming events. If you're new to the community, be sure to subscribe to the News & Announcements and stay up to date with the latest news from our ever-growing membership network who find real "Power in the Community".        LATEST NEWS Power Platform Connections Check out Episode Five of Power Platform Connections, as David Warner II and Hugo Bernier chat with #PowerAutomate Vice President, Stephen Siciliano, alongside reviewing out the great work of Vesa Juvonen, Waldek Mastykarz, Maximilian Müller, Kristine Kolodziejski, Danish Naglekar, Cat Schneider, Victor Dantas, and many more.       Use the hashtag #PowerPlatformConnects on social media for a chance to have your work featured on the show!   Did you miss an episode?  Catch up now in the Community Connections Galleries Power Apps, Power Automate, Power Virtual Agents, Power Pages     Power Platform leading a new era of AI-generated low-code development.   **HOT OFF THE PRESS** Fantastic piece here by Charles Lamanna on how we're reinventing software development with Copilot in Power Platform to help you can build apps, flows, and bots with just a simple description! Click here to see the Product Blog         Copilot for Power Apps - Power CAT Live To follow on from Charles' blog, check out #PowerCATLive as Phil Topness gives Clay Wesener Wesner a tour of the capabilities of Copilot in Power Apps.           UPCOMING EVENTS   Modern Workplace Conference Check out the Power Platform and Microsoft 365 Modern Workplace Conference that returns face-to-face at the Espace St Martin in Paris on 27-28th March. The #MWCP23 will feature a wide range of expert speakers, including Nadia Yahiaoui, Amanda Sterner, Pierre-Henri, Chirag Patel, Chris Hoard, Edyta Gorzoń, Erika Beaumier, Estelle Auberix, Femke Cornelissen, Frank POIREAU, Gaëlle Moreau, Gilles Pommier, Ilya Fainberg, Julie Ecolivet, Mai-Lynn Lien, Marijn Somers, Merethe Stave, Nikki Chapple, Patrick Guimonet, Penda Sow, Pieter Op De Beéck, Rémi Riche, Robin Doudoux, Stéphanie Delcroix, Yves Habersaat and many more.  Click here to find out more and register today!     Business Applications Launch 2023 Join us on Tuesday 4th April 2023 for an in-depth look into the latest updates across Microsoft Power Platform and Microsoft Dynamics 365 that are helping businesses overcome their biggest challenges today. Find out about new features, capabilities, and best practices for connecting data to deliver exceptional customer experiences, collaborating and creating using AI-powered capabilities, driving productivity with automation, and building future growth with today’s leading technology. Click Here to Register Today!       Power Platform Conference 2023 We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5th, 2023! But first, let's take a look below at some fun moments from MPPC 2022 in Orlando Florida. 2023 sees guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, and many more taking part, so why not click the link below to register for the #PowerPlatformConf today! Vegas, baby! Click Here to Register Today!      COMMUNITY HIGHLIGHTS Check out our top Super and Community Users reaching new levels!  These hardworking members are posting, answering questions, kudos, and providing top solutions in their communities.   Power Apps:  Super Users:  @WarrenBelz  |  @iAm_ManCat  Community Users: @LaurensM | @Rusk | @RJM07    Power Automate:   Super Users: @abm  | @Expiscornovus | @RobElliott  Community Users:  @grantjenkins | @Chriddle    Power Virtual Agents:   Super Users: @Expiscornovus | @Pstork1  Community Users: @MisterBates | @Jupyter123 | Kunal K   Power Pages: Super Users:  @OliverRodriguesOliverRodrigues | @Mira_Ghaly  Community Users: @FubarFubar | @ianwukianwuk  LATEST PRODUCT BLOG ARTICLES  Power Apps Community Blog  Power Automate Community Blog  Power Virtual Agents Community Blog  Power Pages Community Blog  Check out 'Using the Community' for more helpful tips and information:  Power Apps, Power Automate, Power Virtual Agents, Power Pages 

Register now for the Business Applications Launch Event | Tuesday, April 4, 2023

Join us for an in-depth look into the latest updates across Microsoft Dynamics 365 and Microsoft Power Platform that are helping businesses overcome their biggest challenges today.   Find out about new features, capabilities, and best practices for connecting data to deliver exceptional customer experiences, collaborating, and creating using AI-powered capabilities, driving productivity with automation—and building towards future growth with today’s leading technology.   Microsoft leaders and experts will guide you through the full 2023 release wave 1 and how these advancements will help you: Expand visibility, reduce time, and enhance creativity in your departments and teams with unified, AI-powered capabilities.Empower your employees to focus on revenue-generating tasks while automating repetitive tasks.Connect people, data, and processes across your organization with modern collaboration tools.Innovate without limits using the latest in low-code development, including new GPT-powered capabilities.    Click Here to Register Today!    

Check out the new Power Platform Communities Front Door Experience!

We are excited to share the ‘Power Platform Communities Front Door’ experience with you!   Front Door brings together content from all the Power Platform communities into a single place for our community members, customers and low-code, no-code enthusiasts to learn, share and engage with peers, advocates, community program managers and our product team members. There are a host of features and new capabilities now available on Power Platform Communities Front Door to make content more discoverable for all power product community users which includes ForumsUser GroupsEventsCommunity highlightsCommunity by numbersLinks to all communities Users can see top discussions from across all the Power Platform communities and easily navigate to the latest or trending posts for further interaction. Additionally, they can filter to individual products as well.   Users can filter and browse the user group events from all power platform products with feature parity to existing community user group experience and added filtering capabilities.     Users can now explore user groups on the Power Platform Front Door landing page with capability to view all products in Power Platform.      Explore Power Platform Communities Front Door today. Visit Power Platform Community Front door to easily navigate to the different product communities, view a roll up of user groups, events and forums.

Microsoft Power Platform Conference | Registration Open | Oct. 3-5 2023

We are so excited to see you for the Microsoft Power Platform Conference in Las Vegas October 3-5 2023! But first, let's take a look back at some fun moments and the best community in tech from MPPC 2022 in Orlando, Florida.   Featuring guest speakers such as Charles Lamanna, Heather Cook, Julie Strauss, Nirav Shah, Ryan Cunningham, Sangya Singh, Stephen Siciliano, Hugo Bernier and many more.   Register today: https://www.powerplatformconf.com/   

Users online (3,408)