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! 😊

17 REPLIES 17
JimmyWork
Resident Rockstar
Resident Rockstar

@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!

Pstork1
Most Valuable Professional
Most Valuable Professional

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.
Pstork1
Most Valuable Professional
Most Valuable Professional

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.

Pstork1
Most Valuable Professional
Most Valuable Professional

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.

Hi @Pstork1 . I was browsing through solutions to a similar requirement and found you. My requirement is much simpler but I am having a heck of a time. I want to create sub folders WHEN i create a Folder in a SPECIFIC CHANNEL.  No matter how many ways I do this, my subfolders do not get created in the CHANNEL. Instead, they are getting created at the Root Level.  

 

So, I know how to create the subfolder. What I DON'T know /CANT figure out is how to get PowerAutomate to recognize the Channel and create the folders there.  

Pstork1
Most Valuable Professional
Most Valuable Professional

The Channel is represented as a folder in the SharePoint Library attached to Teams. So to create subfolders you need to add the Channel name to the front of the folder you want to create.  So if you want a subfolder called TeamNotes in the General channel the folder path would be General/TeamNotes.



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

Apologies for the delay @Pstork1 . I really appreciate your insights. I used them in conjunction with multiple other things, and with trial and error, I was able to make my flow work. I had to jerry-rig a few things but its working for now. Thanks again.

Jon_Andrews
New Member

@PowerPotential were you ever able to get this to work?  This is exactly what I am trying to complete as well.

Edinho10
Regular Visitor

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

 

I've had the same problem with creating the General-folder in Teams without having to press the "Files"-button.

I spent some time examining this case and I tried to configure the flow as @Pstork1 have done, with MS Graph and creating a General-folder on the new teamsite in Sharepoint. While I was struggling with MS Graph and permissions I got an idea. 

 

It's actually possible to skip the steps where MS Graph and "Create new folder" are involved. By naming the folder that we want to copy/move to "General", Teams and SharePoint think that this is the real "General"-folder. The actual folder that we want to copy should be inside the General-folder. I've posted som pics of my flow and the actions that I use.

 

 

 

Create team and copy folder.png

Copy folder.png

It's important that the folder that we are copying/moving is named General in the templibrary. 

We can predict that the destination site address will be https://***.sharepoint.com/sites/name of the new created team. Destination folder is Shared%20Documents. 

 

The solution is that the folder we want to copy should be named General. We are fooling Teams and Sharepoint that this is the real General-folder. 

I've used some variables to make it easier for my self but basically the only thing needed for this flow to succeed is

1. Trigger,

2. Action "Create a team" and

3. Action "Copy folder".

I added a delay before copy folder to be sure that the team and teamsite is created.

 

Hope that this helps you, have a nice day 🙂

Helpful resources

Announcements

Exclusive LIVE Community Event: Power Apps Copilot Coffee Chat with Copilot Studio Product Team

It's time for the SECOND Power Apps Copilot Coffee Chat featuring the Copilot Studio product team, which will be held LIVE on April 3, 2024 at 9:30 AM Pacific Daylight Time (PDT).     This is an incredible opportunity to connect with members of the Copilot Studio product team and ask them anything about Copilot Studio. We'll share our special guests with you shortly--but we want to encourage to mark your calendars now because you will not want to miss the conversation.   This live event will give you the unique opportunity to learn more about Copilot Studio plans, where we’ll focus, and get insight into upcoming features. We’re looking forward to hearing from the community, so bring your questions!   TO GET ACCESS TO THIS EXCLUSIVE AMA: Kudo this post to reserve your spot! Reserve your spot now by kudoing this post.  Reservations will be prioritized on when your kudo for the post comes through, so don't wait! Click that "kudo button" today.   Invitations will be sent on April 2nd.Users posting Kudos after April 2nd at 9AM PDT may not receive an invitation but will be able to view the session online after conclusion of the event. Give your "kudo" today and mark your calendars for April 3, 2024 at 9:30 AM PDT and join us for an engaging and informative session!

Tuesday Tip: Unlocking Community Achievements and Earning Badges

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!     THIS WEEK'S TIP: Unlocking Achievements and Earning BadgesAcross the Communities, you'll see badges on users profile that recognize and reward their engagement and contributions. These badges each signify a different achievement--and all of those achievements are available to any Community member! If you're a seasoned pro or just getting started, you too can earn badges for the great work you do. Check out some details on Community badges below--and find out more in the detailed link at the end of the article!       A Diverse Range of Badges to Collect The badges you can earn in the Community cover a wide array of activities, including: Kudos Received: Acknowledges the number of times a user’s post has been appreciated with a “Kudo.”Kudos Given: Highlights the user’s generosity in recognizing others’ contributions.Topics Created: Tracks the number of discussions initiated by a user.Solutions Provided: Celebrates the instances where a user’s response is marked as the correct solution.Reply: Counts the number of times a user has engaged with community discussions.Blog Contributor: Honors those who contribute valuable content and are invited to write for the community blog.       A Community Evolving Together Badges are not only a great way to recognize outstanding contributions of our amazing Community members--they are also a way to continue fostering a collaborative and supportive environment. As you continue to share your knowledge and assist each other these badges serve as a visual representation of your valuable contributions.   Find out more about badges in these Community Support pages in each Community: All About Community Badges - Power Apps CommunityAll About Community Badges - Power Automate CommunityAll About Community Badges - Copilot Studio CommunityAll About Community Badges - Power Pages Community

Tuesday Tips: Powering Up Your Community Profile

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!   This Week's Tip: Power Up Your Profile!  🚀 It's where every Community member gets their start, and it's essential that you keep it updated! Your Community User Profile is how you're able to get messages, post solutions, ask questions--and as you rank up, it's where your badges will appear and how you'll be known when you start blogging in the Community Blog. Your Community User Profile is how the Community knows you--so it's essential that it works the way you need it to! From changing your username to updating contact information, this Knowledge Base Article is your best resource for powering up your profile.     Password Puzzles? No Problem! Find out how to sync your Azure AD password with your community account, ensuring a seamless sign-in. No separate passwords to remember! Job Jumps & Email Swaps Changed jobs? Got a new email? Fear not! You'll find out how to link your shiny new email to your existing community account, keeping your contributions and connections intact. Username Uncertainties Unraveled Picking the perfect username is crucial--and sometimes the original choice you signed up with doesn't fit as well as you may have thought. There's a quick way to request an update here--but remember, your username is your community identity, so choose wisely. "Need Admin Approval" Warning Window? If you see this error message while using the community, don't worry. A simple process will help you get where you need to go. If you still need assistance, find out how to contact your Community Support team. Whatever you're looking for, when it comes to your profile, the Community Account Support Knowledge Base article is your treasure trove of tips as you navigate the nuances of your Community Profile. It’s the ultimate resource for keeping your digital identity in tip-top shape while engaging with the Power Platform Community. So, dive in and power up your profile today!  💪🚀   Community Account Support | Power Apps Community Account Support | Power AutomateCommunity Account Support | Copilot Studio  Community Account Support | Power Pages

Super User of the Month | Chris Piasecki

In our 2nd installment of this new ongoing feature in the Community, we're thrilled to announce that Chris Piasecki is our Super User of the Month for March 2024. If you've been in the Community for a while, we're sure you've seen a comment or marked one of Chris' helpful tips as a solution--he's been a Super User for SEVEN consecutive seasons!   Since authoring his first reply in April 2020 to his most recent achievement organizing the Canadian Power Platform Summit this month, Chris has helped countless Community members with his insights and expertise. In addition to being a Super User, Chris is also a User Group leader, Microsoft MVP, and a featured speaker at the Microsoft Power Platform Conference. His contributions to the new SUIT program, along with his joyous personality and willingness to jump in and help so many members has made Chris a fixture in the Power Platform Community.   When Chris isn't authoring solutions or organizing events, he's actively leading Piasecki Consulting, specializing in solution architecture, integration, DevOps, and more--helping clients discover how to strategize and implement Microsoft's technology platforms. We are grateful for Chris' insightful help in the Community and look forward to even more amazing milestones as he continues to assist so many with his great tips, solutions--always with a smile and a great sense of humor.You can find Chris in the Community and on LinkedIn. Thanks for being such a SUPER user, Chris! 💪 🌠  

Tuesday Tips: Community Ranks and YOU

TUESDAY TIPS are our way of communicating helpful things we've learned or shared that have helped members of the Community. Whether you're just getting started or you're a seasoned pro, Tuesday Tips will help you know where to go, what to look for, and navigate your way through the ever-growing--and ever-changing--world of the Power Platform Community! We cover basics about the Community, provide a few "insider tips" to make your experience even better, and share best practices gleaned from our most active community members and Super Users.   With so many new Community members joining us each week, we'll also review a few of our "best practices" so you know just "how" the Community works, so make sure to watch the News & Announcements each week for the latest and greatest Tuesday Tips!This Week: Community Ranks--Moving from "Member" to "Community Champion"   Have you ever wondered how your fellow community members ascend the ranks within our community? What sets apart an Advocate from a Helper, or a Solution Sage from a Community Champion? In today’s #TuesdayTip, we’re unveiling the secrets and sharing tips to help YOU elevate your ranking—and why it matters to our vibrant communities. Community ranks serve as a window into a member’s role and activity. They celebrate your accomplishments and reveal whether someone has been actively contributing and assisting others. For instance, a Super User is someone who has been exceptionally helpful and engaged. Some ranks even come with special permissions, especially those related to community management. As you actively participate—whether by creating new topics, providing solutions, or earning kudos—your rank can climb. Each time you achieve a new rank, you’ll receive an email notification. Look out for the icon and rank name displayed next to your username—it’s a badge of honor! Fun fact: Your Community Engagement Team keeps an eye on these ranks, recognizing the most passionate and active community members. So shine brightly with valuable content, and you might just earn well-deserved recognition! Where can you see someone’s rank? When viewing a post, you’ll find a member’s rank to the left of their name.Click on a username to explore their profile, where their rank is prominently displayed. What about the ranks themselves? New members start as New Members, progressing to Regular Visitors, and then Frequent Visitors.Beyond that, we have a categorized system: Kudo Ranks: Earned through kudos (teal icons).Post Ranks: Based on your posts (purple icons).Solution Ranks: Reflecting your solutions (green icons).Combo Ranks: These orange icons combine kudos, solutions, and posts. The top ranks have unique names, making your journey even more exciting! So dive in, collect those kudos, share solutions, and let’s see how high you can rank!  🌟 🚀   Check out the Using the Community boards in each of the communities for more helpful information!  Power Apps, Power Automate, Copilot Studio & Power Pages

Find Out What Makes Super Users So Super

We know many of you visit the Power Platform Communities to ask questions and receive answers. But do you know that many of our best answers and solutions come from Community members who are super active, helping anyone who needs a little help getting unstuck with Business Applications products? We call these dedicated Community members Super Users because they are the real heroes in the Community, willing to jump in whenever they can to help! Maybe you've encountered them yourself and they've solved some of your biggest questions. Have you ever wondered, "Why?"We interviewed several of our Super Users to understand what drives them to help in the Community--and discover the difference it has made in their lives as well! Take a look in our gallery today: What Motivates a Super User? - Power Platform Community (microsoft.com)

Users online (6,768)