Copilot studio new experience handling attachments

Ewan Davies 10 Reputation points
2026-07-01T14:08:34.7866667+00:00

I wanted to share a challenge I have tried to solve - there doesn't seem to be a way around this currently unless I'm missing something.

I'm building a Copilot Studio agent that can serve as a front-line for service desk tickets, and ideally it should be able to take files/screenshots provided by the user, and forward them on the raised ticket on escalation (done via an email).

In the old experience there was some support for handling attachments by grabbing file content in Topics. However in the new experience there doesn't seem to be that option. When I've tried giving the agent in the new experience either the Outlook Send Email tool directly or calling a workflow with a file input. Either way it seems to rely on the orchestrator agent providing the ContentBytes and it tries, but provides corrupted content.

Am I misreading this setup? Is there a way to manage these properly?

Microsoft Copilot | Microsoft 365 Copilot | Development

1 answer

Sort by: Most helpful
  1. AI answer

    2026-07-01T14:09:19.2633333+00:00

    In the new Copilot Studio experience, attachments can still be captured and passed on, but the pattern is different from the classic Topics-only approach and must be wired explicitly so that the file content and name are sent correctly to flows or connectors.

    Key points for the new experience:

    1. Turn on file input and capture the attachment
      • Use a Question node with Identify → File and enable Include file metadata to let the user upload a file during the chat.
      • Alternatively (or additionally), use a Set variable value node with:
             First(System.Activity.Attachments)
        
        This captures an already-attached file (for example, from Teams) as a record with .Name and .Content fields.
    2. Pass the file to a Power Automate (agent) flow When escalating via email, the most reliable pattern in the new experience is to use an agent flow (Power Automate flow) and pass the file explicitly:
      • In the topic, after the Question/variable node that gets the file, add an agent flow.
      • Configure the flow to accept a file-like input and pass it from the topic using a Power Fx record:
             { contentBytes: Topic.userReceipt.Content, name: Topic.userReceipt.Name }
        
        or, if using System.Activity.Attachments directly:
             { contentBytes: First(System.Activity.Attachments).Content,
               name: First(System.Activity.Attachments).Name }
        
      • Inside the flow, this object can then be used to send the file to downstream systems (for example, to a ticketing system or via Outlook/Exchange connectors).
    3. Pass the file when the flow is added as a tool If the escalation email is sent from a workflow/flow used as a tool:
      1. Go to Tools in Copilot Studio and open the flow tool.
      2. Under Inputs, ensure the flow has contentBytes and name inputs (add them if missing).
      3. Set the inputs using System.Activity.Attachments:
              // contentBytes
              First(System.Activity.Attachments).Content
              
              // name
              First(System.Activity.Attachments).Name
        
      4. In the flow, mark the corresponding input as File type where applicable.
      This ensures the orchestrator agent does not “guess” the file payload; instead, the file content and name are passed deterministically from the chat attachment.
    4. Pass the file to connectors (for example, Outlook Send Email) For connectors that expect file attachments (such as Send an email (V2)), the attachment input must be a table of records with contentBytes and name keys. For example:
         [
           {
             contentBytes: Topic.userReceipt.Content,
             name: Topic.userReceipt.Name
           }
         ]
      
      or, using System.Activity.Attachments:
         If(
             IsEmpty(System.Activity.Attachments),
             [],
             [
               {
                 contentBytes: First(System.Activity.Attachments).Content,
                 name: First(System.Activity.Attachments).Name
               }
             ]
         )
      
      This pattern avoids corrupted content by matching exactly what the connector expects.
    5. Important constraint in the new Tools UI On the Tools page, file inputs only work when configured as a Custom value with a Power Fx formula. They do not work when using Dynamically fill with AI for file inputs. For attachment scenarios, always:
      • Use Custom value.
      • Bind to System.Activity.Attachments and shape the record/table to match the connector or flow input.
    6. Summary for a service desk front-line agent For a front-line service desk agent that collects screenshots/files and escalates via email:
      • Capture the file using a Question node or First(System.Activity.Attachments).
      • Use an agent flow or connector tool where contentBytes and name are explicitly mapped from that attachment.
      • For Outlook/Send Email connectors, provide a table of { contentBytes, name } records as shown above.
      With these mappings in place, attachments are passed correctly in the new experience without relying on the orchestrator to infer ContentBytes.

    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.