Microsoft Copilot Studio

Upload File In Copilot Studio (Generative Orchestration Mode)

Upload File In Copilot Studio (Generative Orchestration Mode) Posted by - Matthew Devaney on - July 20, 2025 5 Comments You can upload a file in Copilot Stud...

Matthew Devaney
Published
Reading time
4 min read

Before you start

Is this guide for you?

Best entry point
Microsoft Copilot Studio
Time investment
4 min read

Imported reference from Matthew Devaney's blog for learning purposes. Original: https://www.matthewdevaney.com/upload-file-in-copilot-studio-generative-orchestration-mode/. Author: Matthew Devaney.

Upload File In Copilot Studio (Generative Orchestration Mode) Posted by - Matthew Devaney on - July 20, 2025 5 Comments

You can upload a file in Copilot Studio without prompting the User without using a question node. The User can simply drop a file into the chat window, the Agent will detect the file and then process it. This is made possible by creating a topic that triggers when an activity is performed and checking the Attachments table system variable for files. Table of Contents Introduction: The File Upload Agent

Add A New Topic To The Copilot Studio Agent

Trigger The Topic When A File Is Uploaded In Chat

Get The Filename And Extension For The Uploaded File

Create A New File In OneDrive/SharePoint

Test The File Upload In Generative Orchestration Mode Introduction: The File Upload Agent

A Copilot Studio Agent accepts a file upload from the User in the chat window at anytime. The Agent does not use a question node , nor is it inside a topic before the file is added by the User.

The User’s uploaded file appears in OneDrive/SharePoint.

Add A New Topic To The Copilot Studio Agent

Open Copilot Studio and create a new Agent named File Upload Agent (Generative) . Use this text in the Agent description.

The Agent will receive a file from the user in the chat window, detect it using Generative Orchestration and perform actions on it.

Then go to the Topics tab and add a new Topic from blank named Upload A File To Copilot Studio (Teams) .

Trigger The Topic When A File Is Uploaded In Chat

We want to trigger the topic when a file is uploaded to the chat window. Not when the Agent detects a trigger phrase. To do this, change the trigger type to when an activity occurs .

Then we add a condition to the trigger to specifically detect when a file is uploaded. Open the On Activity properties and change the condition type to formula .

Use this formula as the conidtion. It checks the Attachments table in the System variable to see if it is empty. When the attachments table has a file, it returns true and when there is no file it returns false . Not ( IsEmpty ( System .Activity .Attachments ) Code language: CSS ( css )

Get The Filename And Extension For The Uploaded File

The Agent should communicate to the user that it is going to perform a file upload to let them know what it is doing. Add a message node with the text show below.

Use this formula to get the filename and extension. The First function is necessary because a User can potentially upload more than a single file, but in this simple example we only want to use one. To learn how perform addition validation to ensure there are not multiple files uploaded read this tutorial . First ( System .Activity .Attachments ) .Name Code language: CSS ( css )

Create A New File In OneDrive/SharePoint

We want the Agent to upload a file to OneDrive/SharePoint. Both connectors work in a similar way. For this example, we will use the Create File – OneDrive for Business connector. Then setup the input parameters as follows: Folder Path: (your folder path)

File Name: First(System.Activity.Attachments).Name

File Content: First(System.Activity.Attachments).Content Send A Message To The User

After the file is uploaded we want to send a message to let the User know it was successful. Add a message node with the message “File successfully uploaded to the path {CreateFile.Path}”.

Test The File Upload In Generative Orchestration Mode

We are done. Save the topic. Publish the Agent. And upload a file to the chat window.

The Copilot Studio Agent will upload the file to OneDrive. Did You Enjoy This Article? 😺

Subscribe to get new Copilot Studio articles sent to your inbox each week for FREE Enter your email address Sign Me Up Questions?

If you have any questions or feedback about Upload File In Copilot Studio (Generative Orchestration Mode) please leave a message in the comments section below. You can post using your email address and are not required to create an account to join the discussion. Matthew Devaney Copilot Studio Video

Video: Copilot Studio – Add Human Review to Your AI Agents

Share this

Tagged

Microsoft Copilot Studio

Have a Microsoft 365 topic idea?

Share article suggestions, community session ideas, corrections, or real-world scenarios for future nxtM365 learning notes.

Suggest a topic

Keep learning Microsoft 365

Explore more practical guides for SharePoint, Power Platform, Copilot Studio, migration, automation, governance, and security.

Continue learning

Next action

What to do next

Browse all tutorials →