Hi, based on your requirement, I would recommend Agent Flow rather than using the OneDrive Knowledge Source.
The key distinction is that your requirement is deterministic file processing, rather than semantic retrieval. You want the agent to:
- Go to a specific OneDrive folder.
- Retrieve the files in that folder.
- Process each file.
- Extract the required information.
- Populate a predefined JSON structure.
A Copilot Studio Knowledge Source is primarily designed for search and retrieval based on indexed content. It is therefore not the ideal mechanism when you need to guarantee that every file in a particular folder is processed.
Recommended architecture (See Attachments as well)
Use Copilot Studio → Agent Flow → OneDrive for Business → AI Builder → Copilot Studio.
The flow could be structured as follows:
1. List files in folder – OneDrive for Business
Configure the action with the specific OneDrive folder you want to process. This gives the flow an explicit folder as its starting point rather than asking OneDrive to perform a broad content search.
2. Apply to each
Loop through the files returned by the previous action.
3. Get file content – OneDrive for Business
Use the file identifier from the current iteration to retrieve the actual file content.
4. Run an AI Builder prompt
Pass the file content to an AI Builder prompt configured to extract the required information and populate your predefined JSON schema.
You can also instruct the prompt to return only valid JSON matching your required structure.
5. Return the result to Copilot Studio
The flow can return the generated JSON to the agent, where it can be displayed, stored, or passed to another process.
One additional consideration: if the folder can contain different file types (Word, PDF, Excel, images, etc.), the extraction step may need to be adapted depending on the type of content being processed.