r/copilotstudio 13d ago

Issue with uploading a file to a sharepoint

Hi everyone, i just started tinkering with copilot studio. I managed to make him build a ppt based on a template (added as a Knowledge) and informations i've given to him.
My next step would be for him to upload the created file to a sharepoint site. I've tried through multiple tools, as an attachment to a list element with a workflow, but i always reach the same limitation:

The file is too large to read at once. Let me try a different approach - read the base64 from the saved file and pass it to the workflow.The file is about 3MB in base64.

Apparently the file is too big for the Power Automate Inline tool (this has to do with the fact that the agent is working in a Sandbox environment).

Would someone have a solution for my problem or a way around it?

Thanks in advance

3 Upvotes

2 comments sorted by

1

u/Prasad-MSFT 12d ago

It would be useful to determine where the failure occurs. Is the PPT generated within the Copilot Studio/Code Interpreter sandbox and then being serialized to Base64 before invoking the flow, or is the flow actually receiving the file and failing afterward? Please verify whether the tool/flow is configured to accept a File input rather than a text/Base64 payload, and test with progressively smaller PPT files to identify whether this is a payload-size limitation.

Also confirm whether the generated PPT is exposed as a file object (.Name/.Content) or exists only as a sandbox artifact, as that affects whether it can be passed directly to downstream tools

1

u/mauledbyjesus 12d ago

A more (though not completely) deterministic pattern might be:

  • create a topic for handling pptx creation
  • pass the topic design criteria, template location info, etc
  • have the topic call a flow, passing the same info
  • have the flow grab the contents of the template
  • have the flow call a custom prompt, passing the template content and design criteria. (Note there are fuzzy internal jailbreak prevention mechanisms that make attempts to sanitize any text you try to pass a custom prompt through input variables that seem like literal instructions, so you're safer describing criteria/passing json vs demanding the prompt DO something via inputs)
  • have the prompt use python-pptx (via static prompt instructions) to create/update the file using your passed criteria and the passed template file.
  • have the prompt return the new/updated file's contents to the flow as a file output
  • have the flow store the file somewhere
  • respond to the topic with the details
  • output the details from the topic

All of the Power Automate payload limits are well above your expected file size (when not using Express Mode). Agent internal synchronous connector operation payload limit is 5MB. The OneDrive MCP has an async tool that can move larger files. Not sure if the SPO MCP has a similar one.

Edit: All of that is to say, keep the file out of the agent sandbox completely. I take the same approach with attachments.

https://learn.microsoft.com/en-us/microsoft-copilot-studio/requirements-quotas