Forum Discussion
Get files from SharePoint, send the result to Copilot, show the documents as list inside Copilot
I am trying to create a copilot inside copilot studio, which do the following:-
1) Call a Power Automate Flow to return the documents from a SharePoint online document library.
2) I will select the File name and File URL only
3) Send the documents to Copilot.
4) then i need to build a list inside a Copilot Question, to select a Document, as i want to send the document to another power automate flow.
Here what i have :-
1) Inside Copilot i am calling the flow:-
2) Here is the flow. Where i got the files, Select the Name & Url, initialize the variable with the output of the Select, and return the variable to Copilot, after converting the variable into json() :-
here is sample of the response from the flow:-
{
"r":
"
[
{\"Name\":\"New Microsoft Word Document (4)\",\"Url\":\"https://**.sharepoint.com/sites/Copilot/New/New%20Microsoft%20Word%20Document%20(4).docx?d=w36a23c408c844a4ebf4d444f8777a975\"},
{\"Name\":\"VScompleted\",\"Url\":\"https://**.sharepoint.com/sites/Copilot/New/VScompleted.png\"},
{\"Name\":\"Salary\",\"Url\":\"https://***.sharepoint.com/sites/Copilot/New/Salary.docx?d=wcf24819ffdcf4616873cd50c24f1b1d0\"}
]
"
}
but how i can convert this JSON to a table inside Copilot and show this table as a question to the user, to select a specific document?
Thanks
1 Reply
- AmeliaAdamsIron Contributor
1. Rapid Implementation Methodology
Using Power Automate Processes
Create an automated process:
Log in to Power Automate
Select “Automate Cloud Flow” → New from Template
2. Set up triggers:
Select “Trigger Flow Manually” or “Timed Trigger”
Add SharePoint Action:
Search to add the “Get Files (Properties)” action.
Fill in the name of the target SharePoint site and document library
3. Connect to Copilot:
Add “Microsoft 365 Copilot” action
Select “Generate Summary” or “Create List”.
4. Set the output:
Pass SharePoint file information to Copilot
Specify the output format (e.g. Markdown table)
5. Customize with Copilot Studio:
Open Copilot Studio
Create a new Copilot → Select “Connect to Data”.
Select “SharePoint” as the data source
Set file filtering criteria (e.g. folder path/file type)
Add instructions in the “Generate Answers” section:
“Display SharePoint files as a linked list with filename, modification date and author”.
6. Integrate directly through SharePoint
Enable Copilot in the document library:
Open the target SharePoint document library
Click the “Copilot” button in the upper right corner (requires administrator enablement)
Enter natural language commands such as:
“Show a list of all documents in this library, sorted by modification date”.
7. Sample effect
Example of Copilot output format:
| file name | modification date | author | link |
|--------|----------|------|------|
| ProjectReport.docx | 2024-03-15 | URL | [View](link) |
| Budget Sheet.xlsx | 2024-03-10 | Li Si | [View](link) |