Forum Discussion
Help building an Agent Flow to access specific folders in Sharepoint
Hi all,
I am building an agent that needs to access specific subfolders (based on folder identifier) and then analyse this folder against the instructions for the agent.
The planned flow is:
- User enters folder identifier (e.g. Vehicle registration number)
- The CoPilot Studio Agent uses an Agent Flow to find the Registration number folder within the SharePoint repository (which contains many folders for different cars). The Agent Flow helps the agent access the specific car's folder.
- The agent runs the instructions for this specific car, analysing the subfolders (e.g. Insurance documents, fuel expense history) to return to the user the outcome of the analysis for each subfolder within that registration's folder.
My issue is getting the SharePoint access Agent Flow to work. I have tried using CoPilot chat to assist, but it gives a million different ways to accomplish the same thing. I understand that I need to trigger the flow, using "CarReg" as the input. Then I can use Get Files (Properties Only) to return and filter by folders to find the car registration. But now I only have the folder names, and not the underlying files for my agent to use.
Also, once I perform the filter to get the relevant folder, I have many options of passing this back to the agent, such as via HTML tables or Compose. Is there a preferred method?
Thanks,
H777
1 Reply
- SK_19Copper Contributor
Trigger flow with CarReg input; resolve folder path via Get Files (Properties Only) + filter
Recursively enumerate the subfolders (Insurance, Fuel, etc.) and pull file contents
Return structured JSON (not HTML tables) back to Copilot Studio — cleaner for agent parsing
Handle edge cases: missing folders, duplicate CarRegs, permission errors
Per-subfolder analysis blocks so the agent reports each category separately