
Saving and Working with Attachments in Copilot Studio
Introduction Recently, I was building an agent in Copilot Studio (Classic) that needed to accept files from chat and save them later in the flow. The common approach is to pass a single file straight to a tool call using System.Activity.Attachments - but you can only pass one file, not the array. That works for simple cases, but it introduces two problems: It does not handle multiple files. If you have more than one file in a single message, you can only save the first or last one. The agent will also only call the tool once System.Activity.Attachments only exists on the current activity, so attachments can be lost if you perform other actions first The main reason for this issue is the agent is using the Bot Framework’s System.Activity object, which is designed to last for a single turn. Once the turn is processed, the attachments are no longer available. ...
