web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Copilot Studio / The long PDF passed fr...
Copilot Studio
Suggested Answer

The long PDF passed from the trigger is not being read until the end

(0) ShareShare
ReportReport
Posted on by

I am creating an agent in Copilot Studio to summarize PDFs.
The PDF to be read is passed from the trigger "When a new email arrives (V3).
However, it seems that the summary is created using only the content from the first two to three pages, without reading the entire PDF.
If anyone knows the cause and solution, I would appreciate your guidance.

 

■Instructions
・The PDF file name (including extension) will be passed from the trigger.
・Retrieve the corresponding file (including extension) with the given PDF file name from any of the SharePoints set as the knowledge base, and summarize its content in an easy-to-understand way.
・As preprocessing for the summary, extract all text data from the PDF file.
・Be sure to check until the final page of the PDF and extract all text, not just partial content.
・Summarize based on the extracted text data.
・Post the summarized content on Teams.
Please follow the instructions below for summarization: .......

■Knowledge
SharePoint

■Tool
Teams

■Trigger
When a new email arrives (V3)

{
  "type": "OpenApiConnectionNotification",
  "inputs": {
    "parameters": {
      "subjectFilter": "リム電力レポート",
      "fetchOnlyWithAttachment": true
    },
    "host": {
      "apiId": "/providers/Microsoft.PowerApps/apis/shared_office365",
      "connection": "shared_office365",
      "operationId": "OnNewEmailV3"
    }
  }
}
{
  "type": "InitializeVariable",
  "inputs": {
    "variables": [
      {
        "name": "FileNames",
        "type": "array"
      }
    ]
  },
  "runAfter": {}
}
{
  "type": "Foreach",
  "foreach": "@triggerOutputs()?['body/value']",
  "actions": {
    "Apply_to_each": {
      "type": "Foreach",
      "foreach": "@item()?['attachments']",
      "actions": {
        "Create_file": {
          "type": "OpenApiConnection",
          "inputs": {
            "parameters": {
              "dataset": "https://globaleng0101.sharepoint.com/sites/DX",
              "folderPath": "/Shared Documents/DX推進/Copilotエージェントテスト",
              "name": "@item()?['name']",
              "body": "@item()?['contentBytes']"
            },
            "host": {
              "apiId": "/providers/Microsoft.PowerApps/apis/shared_sharepointonline",
              "connection": "shared_sharepointonline",
              "operationId": "CreateFile"
            }
          },
          "runtimeConfiguration": {
            "contentTransfer": {
              "transferMode": "Chunked"
            }
          }
        },
        "Append_to_array_variable": {
          "type": "AppendToArrayVariable",
          "inputs": {
            "name": "FileNames",
            "value": "@outputs('Create_file')?['body/Name']"
          },
          "runAfter": {
            "Create_file": [
              "Succeeded"
            ]
          }
        }
      }
    }
  },
  "runAfter": {
    "Initialize_variable": [
      "Succeeded"
    ]
  }
}
 
{
  "type": "OpenApiConnection",
  "inputs": {
    "parameters": {
      "Copilot": "crd1d_wzS8f-yR7ZIQw25-ZzROH",
      "body/message": "Use content from @{join(variables('FileNames'),',')}"
    },
    "host": {
      "apiId": "/providers/Microsoft.PowerApps/apis/shared_microsoftcopilotstudio",
      "connection": "shared_microsoftcopilotstudio",
      "operationId": "ExecuteCopilot"
    }
  },
  "runAfter": {
    "For_each": [
      "Succeeded"
    ]
  }
}
I have the same question (0)
  • Suggested answer
    Sam_Fawzi Profile Picture
    919 Super User 2026 Season 1 on at
     
    A few different things could cause this, and which one it is depends on how your flow and agent are wired, so here are some questions to narrow it down, with what each answer would likely mean:
     
    1. Are you calling the summary agent in the same flow run, right after Create file?
    If yes then the file may not be fully indexed yet when the agent runs. SharePoint knowledge indexing happens on a schedule, not on demand, so the agent can be racing the indexer and grounding on an incomplete (or missing) copy. Quick test: run the same file through the agent again an hour later, if it reads more of the document, timing/indexing is a factor.
    2. Is the agent reading the PDF through the SharePoint knowledge source, or are you passing the content into the agent's message?
    If it's via the knowledge source then that's retrieval (RAG), not a full read. The agent only gets the top few chunks that match the prompt, and for a "summarize" prompt those chunks almost always come from the opening pages , which matches the "only 2-3 pages" symptom exactly. No instruction can override this, because retrieval decides what reaches the model before the instructions run.
    3. Is the PDF a digital/text PDF, or a scanned image?
    If it's scanned | text extraction returns little or nothing without OCR, so the agent may only pick up whatever thin text layer exists (often just a header or first page).
    4. Is the file larger than 7 MB, and does your tenant have a Microsoft 365 Copilot license?
    If over 7 MB with no license ( generative answers silently skip the file, with no error).
    5. How long is the document?
    If it's very long even passing the content directly can exceed the agent's input/token limit, so it may only process the portion that fits.
     
     
    If 1 or 2 is the cause (my guess, given the symptom), the most reliable fix is to take the index out of the path: extract the text in the flow and pass it into the ExecuteCopilot message directly ,  like a direct upload rather than a knowledge lookup then instruct the agent to read the full provided document before answering. That isolates the indexing question entirely. Just be aware 3 and 5 can surface once you do (OCR for scans, chunking for long docs).
    What does your setup look like on 1 and 2? That'll tell us which path to go down.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
sannavajjala87 Profile Picture

sannavajjala87 202 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 196

#3
Valantis Profile Picture

Valantis 154

Last 30 days Overall leaderboard