Text extraction from file in Copilot Studio - How?

Karl, Melanie 0 Reputation points
2025-12-03T12:34:23.22+00:00

Dear Experts,

I want to create an agent who can detect file uploads in the chat with the user.

I already found out, that i can store the file in a variable when asking the user to upload it via a question node.

Now my problem is, that my agent won't process the file any further.

For example a user uploads a pdf and I want the agent to sum up or translate the text in the pdf, the agent won't do so and I guess it is because he will not recognize text but binary.

Does anyone here have a structured idea of what I could do to configure a topic in which my agent can access the content in this file for further processing?

Your help is very much appreciated!

PS: I have of course enabled the file upload in the settings. My environment does not have access to AI Builder.

Microsoft Copilot | Microsoft 365 Copilot | Development
{count} votes

2 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-03T12:34:42.8566667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To enable your agent in Copilot Studio to process uploaded files, such as PDFs, you'll need to implement a structured approach to extract text from the file after it has been uploaded. Here are the steps you can follow:

    1. File Upload Handling: Ensure that you have set up a Question node to allow users to upload files. You can store the uploaded file in a variable using the First(System.Activity.Attachments) variable to check if a file was attached.
    2. Document Processing: After the file is uploaded, you need to configure your agent to process the document. This typically involves using a document processing agent that can extract text from the uploaded PDF. You can set up workflows that trigger when a new document is added to a specified location (like SharePoint or Outlook).
    3. Extraction Workflow: The document processing agent should include an extraction prompt that sends the uploaded document to an AI model (like GPT) to extract relevant information. This extracted content can then be formatted as needed (e.g., summarized or translated).
    4. Configuration: Make sure to configure the document processing agent properly, including setting up connection references and environment variables that the agent will use to access the uploaded files and perform the necessary actions.

    By following these steps, your agent should be able to recognize the uploaded file, extract the text, and perform further processing like summarization or translation.


    References:

    0 comments No comments

  2. Sayali-MSFT 4,341 Reputation points Microsoft External Staff Moderator
    2025-12-05T11:31:47.96+00:00

    hELLO
    Hello Karl, Melanie, You’re correct—the file upload variable only stores the binary reference, not the actual text content. Copilot Studio does not automatically extract or process file contents unless you explicitly configure an action or connector to do so.
    The uploaded file is stored as a binary object or URL, not parsed text. Without AI Builder or a custom connector, the agent cannot interpret the file contents.

    1. Upload the file:

    Add a Question node that lets the user upload a file, and save the file link or ID in a variable (e.g., uploadedFile).

    1. Extract the text:

    You can do this using Power Automate:

    • Create a flow triggered by the agent (via an Action node).
    • Steps in the flow:
    1. Get the file from the variable (URL or ID).
    2. Use Power Automate connectors:
    3. SharePoint / OneDrive → Get file content.
    4. AI Builder (if available) → Extract text from PDF.
    5. If AI Builder is not available, use a custom script or Azure Cognitive Services for OCR/text extraction.
    • Return extracted text to Copilot Studio.
    1. Process the Extracted Text
    • Once text is returned:
    1. Store it in a variable (e.g., fileText).
    2. Use Copilot Studio’s generative orchestration to summarize or translate it.
    0 comments No comments

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.