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

Community site session details

Session Id :
Copilot Studio - Copilot Studio pre-built Agent...
Unanswered

Need to read the content from file using copilot agent facing issue

(0) ShareShare
ReportReport
Posted on by

Hello,

I’m currently building an agent in Copilot Studio. The goal is to read files from a knowledge repository and answer user queries based solely on the selected file. Since the repository contains multiple folders and files, having Copilot scan the entire repository is not suitable for my use case.

So far, I’ve implemented the following:

  • The agent prompts the user to choose a folder.
  • Based on the input, it opens the selected folder and displays all the files.
  • The user then selects a file, and I capture the filename.

Up to this point, everything works as expected. However, I’m now stuck at the next step: I need to read the contents of the selected file (which could be a PDF, Excel, PPT, etc.) and ensure that Copilot responds only based on that file’s content. 

Could you please guide me on how to achieve this within Copilot Studio?

Note: The agent must respond accurately and provide answers strictly based on the content of the selected file.

 

Regards,

R Kamesh

I have the same question (0)
  • Michael E. Gernaey Profile Picture
    48,900 Super User 2025 Season 2 on at
    Need to read the content from file using copilot agent facing issue
     
    So in your case, the data itself is not really formatted in a way for it to answer. It doesn't know those are steps, there is probably no markdown, I have no idea what the JSON looks like, but it just looks like strings probably, so that won't tell it that the bullets are steps, the content is clear.
     
    So you can, create either an Agent Flow, or a Power Automate flow, to take the data you get back from the first Gen/node, pass it to that, format it into a proper JSON (aka Table), so that it can be read by your Gen 2 Node and be able to answer.
     
    As for seeing what it looks like now, its probably just looking just like what you wrote in the first place from the document, but just do a Send Message, sending Var2.
     
    What you want is a well formatted structured JSON that clearly defines what the values (and nodes) mean so it can be interpreted. Again you may also want to change the fact that you have a sentence the post defines what the steps are, versus pre-defines them so the Gen understands you are stating these are the steps, but make it clear its the bullet points.
     
    But when you get back an answer, and you simply turn it into a table, its probably just a table of strings, which doesn't mean much relative to it being identified as a Step, which is what your next question is.
     
     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Copilot Studio

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 420 Super User 2025 Season 2

#2
trice602 Profile Picture

trice602 141 Super User 2025 Season 2

#3
Jerry-IN Profile Picture

Jerry-IN 68

Last 30 days Overall leaderboard