Create Document Set & Bulk File Upload to SharePoint Using Copilot Studio​

Using Copilot Studio Create Document Set & Bulk File Upload in SharePoint Online – Complete Guide

No comments

Loading

In this “Copilot Studio Create Document Set” tutorial, we will learn how to create a document set in SharePoint Online using the Copilot Studio “Create New Document Set” tool and how to upload bulk files inside the document set dynamically using the Copilot Studio tool.

Managing documents effectively is one of the biggest challenges in any organization. SharePoint Online offers document set to group related files together, but traditionally, creating document sets and uploading multiple files requires manual work or Power Automate flows.

In this article, we’ll walk you through a complete end-to-end project using Microsoft Copilot Studio to:

  • Create a custom document set content type
  • Dynamically generate document sets with AI Copilot
  • Check if a document set already exists before creating a new one
  • Upload multiple files in bulk into the document set
  • Automate everything with smart use of Copilot tools

By the end, you’ll see how Copilot Studio transforms SharePoint document management into a streamlined, AI-powered process.

Why Use Document Set in SharePoint Online?

A document set in SharePoint Online is like a specialized folder that comes with metadata, templates, and versioning support. It’s widely used for projects, case files, HR onboarding packages, contracts, and compliance records.

Traditionally, creating and managing document sets requires manual steps in the SharePoint UI or complex workflows in Power Automate. With Copilot Studio, we can achieve the same automation with much less effort and more flexibility.

Step 1: Create a Document Set Content Type

The first step is enabling document set content types in SharePoint Online. Once enabled, you can create a custom content type that defines metadata, templates, and default documents for your sets.

  • Navigate to the SharePoint Content Type Gallery in the admin center.
  • Add a new content type based on Document Set.
  • Customize it with fields (Project Name, Department, Status, etc.) as per your needs.
Create Document Set Content type in SharePoint
Create Document Set Content type in SharePoint

Read my previous detailed article on how to Create content type in SharePoint Online using PnP PowerShell

This content type will act as the foundation for all future document sets created via Copilot Studio.

Note:

  • Before creating the document set content type, you must activate the document set site collection feature.
  • Once you have created your new document set content type, add this to your document library and copy the content type add from there; we need this while configuring the create new document set tool in Copilot Studio.

Step 2: Dynamically Create Document Set Using Copilot Studio

In Copilot Studio, you can call the Create Document Set tool to generate document sets dynamically. Instead of manually creating them in SharePoint, your Copilot agent can take input (like Project ID or Client Name) and automatically create the corresponding set.

This ensures:

  • Faster onboarding of projects
  • Consistent naming conventions
  • Reduced manual errors

Step 3: Use “Get File Properties” to Check Existing Sets

Before creating a new document set, it’s important to check if it already exists. Otherwise, you’ll end up with duplicates.

Copilot Studio’s Get File Properties tool helps retrieve details of existing files or sets. By using this step:

  • You avoid duplicate document sets
  • Ensure data integrity
  • Keep your SharePoint library clean and organized

Step 4: Bulk Upload Files into Document Set

One of the most powerful parts of this project is the ability to upload multiple files at once using the Create File tool in Copilot Studio.

Instead of dragging and dropping files manually in SharePoint, your Copilot agent can:

  • Accept a list of files
  • Upload them directly into the document set
  • Maintain metadata and hierarchy

This feature is a game-changer for HR onboarding (uploading forms), legal (contract packages), or project management (design docs, SOWs, timelines).

Step 5: Combine Tools for End-to-End Automation

The real power comes when you combine:

  • Get File Properties → check if the set exists
  • Create New Document Set → generate if missing
  • Create File → upload bulk files

With these steps stitched together, you get a complete automation project in Copilot Studio without writing code or creating complex Power Automate flows.

Configuration in Copilot Studio to Create New Document Set in SharePoint Online

In this section I will explain what the configurations are that are needed in Copilot Studio to deploy this end-to-end document management system using the Generative AI:

Step 1: Add required tools to your agent

Add the following tools to your agent:

  • Create file: This will create a new file inside the new document set.
  • Create new document set: This will create a new document set.
  • Two sets of Get file properties only: Using one get file properties tool will check whether the given document set already exists, and using the other one, we will get the query for the last document set name where we will upload files.

Copilot Studio Tools To Create Document Set

Copilot Studio Tools To Create Document Set

Read my detailed article on how to upload multiple files in the SharePoint Online Document Library using the create file tool: With Copilot Studio How to Upload Multiple Files to SharePoint Instantly in 7 Steps

Step 2: Create new document set tool configuration

In the “Create new document set” tool, pass your site URL, document library name and document set content type ID you just created in the step just above.

Create new document set tool configuration in Copilot Studio
Create new document set tool configuration in Copilot Studio

Step 3: Create custom topic and configure it

I have created a custom topic to handle the multiple file upload scenario; I will explain each action configuration here one by one:

At the very first step, I have added the get files (properties only) tool (the second one from my tools list) to get the last document set name from my document library; I have stored that in a variable.

Get last document set name using Copilot Studio Query
Get last document set name using Copilot Studio Query

To get the last document set name from my document library, I am using the below formula and assigning it to a variable:

Last(Global.varGetAllDocumentSets3).'{Name}
Get last document set name using Copilot Studio Formula
Get last document set name using Copilot Studio Formula

Then, I am storing the user file attachments (System.Activity.Attachments) in a variable, then looping through this variable, and I am calling my create file tool inside this loop.

Store file attachments in a variable in Copilot Studio
Store file attachments in a variable in Copilot Studio

Read my previous detailed article on how to loop through variables in Copilot Studio: Foreach Loop in Copilot Studio: Iterate Through Collection Variable in Copilot Agent

Loop through file attachments in Copilot Agent
Loop through file attachments in Copilot Agent

Note:

  • The Loop value 1 variable must be a global type so that you can call this outside the topic, and you need to call this from the Create file tool for the dynamic file name and file content parameter.

If you notice inside the loop through a list, I am calling my Create file tool, where I am using the folder path as below. step is a tricky one; it took a lot of time to figure this out.

Concatenate("/Your Document Library/",Global.varLastDocumentSetName)
Dynamic folder path configuration in Create file Copilot Studio tool
Dynamic folder path configuration in Create file Copilot Studio tool

Step 4: Instructions or Prompt Configuration

Finally, configure the instructions or prompt for your agent to handle your end-to-end document management process:

Follow these steps one by one; do not proceed to the next step until you complete the previous step.

  • Ask the user for the Document Set Name.
  • Construct the Document Set Path as: {Document Set Name}. Example: if the user enters TestDocumentSet1, the path is \TestDocumentSet1.
  • Check whether a document set already exists at the constructed path using an if condition (existence check).
  • If the document set does not exist, create a new document set with the provided name.
  • Store the newly created document set in a variable named {My newly created document set}.
  • Return the link/URL of {My newly created document set} to the user.
  • Ask the user if they want to upload file(s) into {My newly created document set}.
  • If the user says yes, ask them to attach the file(s) in the chatbot.
  • Upload all attached file(s) into the SharePoint location for {My newly created document set}.
  • After the upload completes, return the URL for each uploaded file to the user.
Instructions configuration in Copilot Studio Agent for created new document set
Instructions configuration in Copilot Studio Agent for created new document set

Demo: Using Copilot Studio Create Document Set

Watch this complete demo on my YouTube channel and try it in your environment and see how much time you save.

Benefits of Using Copilot Studio for SharePoint Document Management

  • Faster project setup with zero manual effort
  • Bulk file upload saves hours of repetitive work
  • Prevents duplicate document sets
  • AI-powered automation without coding
  • Seamless integration with SharePoint Online

This approach is not just a demo—it’s a practical solution for real business needs.

Final Thoughts

Thus, in this “Copilot Studio Create Document Set” tutorial, we have learnt how to create a document set in SharePoint Online using the Copilot Studio “Create New Document Set” tool and how to upload bulk files inside the document set dynamically using the Copilot Studio tool.

With Copilot Studio, SharePoint Online document management moves to the next level. Whether you’re in HR, legal, IT, or project management, automating document set creation and bulk file uploads will save time, reduce errors, and improve compliance.

If you’re still relying on manual uploads or Power Automate flows, this project shows how you can supercharge your workflow with Copilot Studio.

Refer to this Microsoft article for more details on document set in SharePoint Online: Create and configure a new Document Set content type

About Post Author

Do you have a better solution or question on this topic? Please leave a comment