As a SharePoint developer, one of the recurring tasks we come across is provisioning new development sites for team members. Now imagine a scenario where a Copilot (an agent) can do this for us just by collecting some basic inputs from the user. Sounds cool, right? Let’s build that!
In this blog post, we’ll learn how to create a custom agent using Microsoft Copilot Studio, which will help automate the SharePoint Dev site creation process. We’ll also make the agent collect necessary details from the user using multiple-choice questions and trigger the backend flow for site creation.
🛠️ Scenario
Let’s say you’ve joined a team as a new SharePoint developer. You need a dev site to start working. Instead of filling out a boring form or waiting for IT, you just chat with a Copilot:
“Hi, I’m Gowtham. I need a new SharePoint Dev site.”
Boom! The Copilot collects all required info and provisions the site for you. Let’s build this!
🧱 Tools Used
- Microsoft Copilot Studio: for creating the agent
- Power Automate: for backend site provisioning logic
- SharePoint Online: as the target environment
1️⃣ Step 1. Create a New Agent in Copilot Studio
✅ Step 2. Define the Greeting and Trigger Phrase
👉 Yes, this becomes a topic in Copilot Studio.
- In Copilot Studio, go to Topics.
- Create a new topic called Create SharePoint Dev Site.
- Add trigger phrases like:
"I need a SharePoint development site"
"Create new SharePoint site"
"Provision site for new team member"
![Create Sharepoint dev site]()
3️⃣ Step 3. Ask User for Required Inputs
In this step, we’ll collect all necessary details using multiple-choice questions and Text Inputs.
Click on + Add a node → Ask a question → select Multiple choice.
Some useful questions to ask:
- What type of site do you need?
- Choices: Team Site, Communication Site, Project Site.
![Type of site]()
- Which business unit are you part of?
- Choices: HR, IT, Finance, Marketing
![Business]()
- What level of access do you need?
- Choices: Owner, Member, Visitor
![Level of access]()
- Enter your desired site name (Use Text input)
![Enter your desired site name]()
Save the responses into variables like:
- varSiteType
- varBusinessUnit
- varAccessLevel
- varSiteName
4️⃣ Step 4. Call Power Automate Flow
Once you have all the details, click + Add a node → Add an action → Create a new flow.
![]()
Create New Agent Flow,
![Create new Agent flow]()
You will be redirected to this screen,
![Redirected to the screen]()
In Power Automate
- Trigger: When a Copilot is called
- Actions:
- Use an HTTP request to SharePoint to create a site collection using the details collected.
- Or use the SharePoint connector to automate site creation.
Pass the values from Copilot variables like this:
- Site Name: varSiteName
- Site Type: varSiteType
- Business Unit: varBusinessUnit
- Access Level: varAccessLevel
Use these to build your site URL and set permissions accordingly.
For testing, I have hard-coded, but later we can change to agent Variables like this,
"Title": "@{triggerBody()['siteName']}",
"Url": "sites/@{replace(triggerBody()['siteName'], ' ', '')}",
"WebTemplate":"@{if(equals(triggerBody()['siteType'], 'Communication Site'), 'SITEPAGEPUBLISHING#0', 'STS#3')}",
![Http request]()
Headers
{ "Accept": "application/json;odata=verbose", "Content-Type": "application/json;odata=verbose" }
Body
{
"request": {
"Title": "My Communication Site",
"Url": "https://fortunestrikes.sharepoint.com/sites/MyDevCommSite",
"Description": "My Communication Site created using Power Automate flow",
"Owner": "[email protected]",
"Lcid": 1033,
"WebTemplate": "SITEPAGEPUBLISHING#0",
"SiteDesignId": "6142d2a0-63a5-4ba0-aede-d9fefca2c767",
"ShareByEmailEnabled": false
}
}
Save and publish this flow.
![Save and publish this flow]()
Now we can see the input variable in our Agent,
![Action]()
🧪 Example Conversation
Here’s how the interaction might look:
User: Hi, I need a SharePoint dev site
Agent: Sure! What type of site do you need?
![Test your agent]()
User: Team Site
Agent: Which business unit are you part of?
User: IT
Agent: What level of access do you want?
User: Owner
Agent: Great! What would you like to name your site?
User: Gowtham Dev Site1
![conversation]()
Note. Check the flow Actions have the right permission like this,
![]()
Agent: Creating your site... ✅ You will receive a confirmation email shortly.
![creating site]()
The Agent Flows,
![Agent flows]()
✅ Benefits
- Time-saving: No more waiting on tickets
- Standardization: All sites follow a template
- Smart UX: Easy for non-tech users to request sites
🚀 Final Thoughts
This is just one of the many ways you can use Microsoft Copilot Studio in a real-world SharePoint scenario. You can extend this by adding approval workflows, email notifications, or even Microsoft Teams integration.
Next time a new resource joins your SharePoint team, let your agent do the onboarding! 💼✨
If you find this article helpful, do give it a thumbs up and share it with your SharePoint squad! Let me know in the comments how you're using Copilot in your organization.