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 / Read Data from Excel s...
Copilot Studio
Suggested Answer

Read Data from Excel sheet by Running the Prompt??

(3) ShareShare
ReportReport
Posted on by 38
I have an excel file , which has multiple sheet , i need to fetch data from each sheet and put in to a variable. i saved the file in SharePoint library and trying to build the agent flow. "File Content" action output is like this..Question is How do i read data from each tab columns ( like Sheet 1 --> Column I from Row number 10)?
 
I am runing a prompt so i can read the data from each sheet. Code of my prompt is like this
 
----------------------------------------------
 
-------------------------------------------
 
File Content Output

{
    "statusCode": 200,
    "headers": {
        "Cache-Control": "max-age=0, private",
        "Vary": "Origin",
        "X-NetworkStatistics": "1,8388480,135,657,4635120,10906936,10906936,71399",
        "X-SharePointHealthScore": "2",
        "X-MS-SPConnector": "1",
        "x-ms-content-sensitivitylabel-id": "1ecdf243-b9b0-4f63-8694-76742e4201b7",
        "x-ms-content-sensitivitylabel-name": "Proprietary+%5c+Proprietary+general",
        "X-SP-SERVERSTATE": "ReadOnly=0",
        "DATASERVICEVERSION": "3.0",
        "SPClientServiceRequestDuration": "118",
        "IsOCDI": "0",
        "X-DataBoundary": "NONE",
        "X-1DSCollectorUrl": "https://mobile.events.data.microsoft.com/OneCollector/1.0/",
        "X-AriaCollectorURL": "https://browser.pipe.aria.microsoft.com/Collector/3.0/",
        "SPRequestGuid": "7eadcb8d-165c-47cf-b0df-428c1265d42f",
        "request-id": "7eadcb8d-165c-47cf-b0df-428c1265d42f",
        "MS-CV": "oiT7EZKgAADk2Zv1keWWsw.0",
        "SPLogId": "11fb24a2-a092-0000-e4d9-9bf591e596b3",
        "Alt-Svc": "h3=\":443\"",
        "Strict-Transport-Security": "max-age=31536000",
        "X-Frame-Options": "SAMEORIGIN",
        "Content-Security-Policy": "frame-ancestors 'self' teams.microsoft.com *.teams.microsoft.com *.skype.com *.teams.microsoft.us local.teams.office.com teams.cloud.microsoft *.office365.com goals.cloud.microsoft *.powerapps.com *.powerbi.com *.yammer.com engage.cloud.microsoft word.cloud.microsoft excel.cloud.microsoft powerpoint.cloud.microsoft *.officeapps.live.com *.office.com *.microsoft365.com m365.cloud.microsoft *.cloud.microsoft *.stream.azure-test.net *.dynamics.com *.microsoft.com onedrive.live.com *.onedrive.live.com teams.microsoft.com *.teams.microsoft.com securebroker.sharepointonline.com;",
        "MicrosoftSharePointTeamServices": "16.0.0.27424",
        "X-Content-Type-Options": "nosniff",
        "X-MS-InvokeApp": "1; RequireReadOnly",
        "X-Cache": "CONFIG_NOCACHE",
        "X-MSEdge-Ref": "Ref A: 79AC2A812BD64C99A3DC021477F2314B Ref B: SJC211051204047 Ref C: 2026-07-07T16:58:25Z",
        "P3P": "CP=\"ALL IND DSP COR ADM CONo CUR CUSo IVAo IVDo PSA PSD TAI TELo OUR SAMo CNT COM INT NAV ONL PHY PRE PUR UNI\"",
        "X-AspNet-Version": "4.0.30319",
        "X-Powered-By": "ASP.NET",
        "x-ms-environment-id": "3e9ef524-2f69-ee85-b81c-c93888a43106",
        "x-ms-tenant-id": "fabb61b8-3afe-4e75-b934-a47f782b8cd7",
        "x-ms-subscription-id": "3e9ef524-2f69-ee85-b81c-c93888a43106",
        "x-ms-dlp-re": "GetFileContentByPath|False|2026-06-30T23:11:26.6202359+00:00",
        "x-ms-dlp-gu": "-|-",
        "x-ms-dlp-ef": "-|-/-|-|-|-|-",
        "x-ms-mip-sl": "-|-|-|-",
        "x-ms-au-creator-id": "e16d9485-5b93-414e-975a-7b3dd2b5169e",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "false",
        "x-ms-apihub-obo": "false",
        "Date": "Tue, 07 Jul 2026 16:58:25 GMT",
        "Content-Length": "1380394",
        "Content-Type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "Expires": "Mon, 22 Jun 2026 16:58:25 GMT",
        "Last-Modified": "Tue, 07 Jul 2026 16:58:25 GMT"
    },
    "body": {
        "$content-type": "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
        "$content": "UEsDBBQABgAIAAAAIQAL/iujrQIAAKsVAAATALMBd3"
 
Agent flow is like This



 
  • Suggested answer
    Giraldoj Profile Picture
    1,005 Super User 2026 Season 2 on at
    Hi there!
     
    thats not going to work, though workflows the agent can only get the file content but can tell whats is inside, also in flows you can only work with tables, if your data is not inside a table basic workflow actions
     
    however if you use a custom prompt and enable code interpreter you should be able to fetch the data you need.

    you have some samples on how to use custom prompts bellow
     
    Hope this helps!  
    ✅ If this helped, please consider marking it as Accepted Solution.
    👍 If you found it useful, a quick Like is appreciated!
    🔗 Feel free to connect with me on LinkedIn:
    https://www.linkedin.com/in/jhonatan-giraldo-2b20561b9/
     
  • Suggested answer
    Robu1 Profile Picture
    1,709 Super User 2026 Season 2 on at
     
    Thank you for choosing Microsoft Community.
     
    Copilot Studio cannot read Excel.
    Power Automate or Office Scripts must do the extraction, then return JSON or text.
     
    You must parse the Excel file outside Copilot Studio, then return structured data.
     
    You can to do this in 
    Power Automate -Get file content
    Use Excel connector to read sheets/rows/columns
    Return JSON to Copilot Studio
     
    You could also 
    Convert Excel → CSV in Power Automate
    Lightweight
    Return CSV text
    Parse inside Copilot Studio or Office Scripts must do the extraction, then return JSON or text.
     
    Thanks.
     
    If I've helped solve your query, kindly mark my response as the solution ✔ and like my suggestion ❤️  Your feedback supports future seekers 🚀
     
    Happy to help 
    Robu 1
  • N962908 Profile Picture
    38 on at
    Article looks Gr8.. How do i pass my Excel as Input Content in the Prompt
     
    Only supported formet is Images(.jpg.gif etc.) and .pdf. 
     
  • Suggested answer
    Valantis Profile Picture
    7,266 Super User 2026 Season 2 on at
     
    The confirmed working pattern for reading specific cells from multiple sheets is Power Automate with Office Scripts.
     
    Here's the exact approach:
     
    1. In Power Automate, add a Run script (Excel Online Business) action pointing to your SharePoint file
    2. Write an Office Script that reads your specific data:
    function main(workbook: ExcelScript.Workbook): string {
      const sheet1 = workbook.getWorksheet("Sheet1");
      const valueFromI10 = sheet1.getCell(9, 8).getValue(); // Row 10 = index 9, Column I = index 8
      return JSON.stringify({ sheet1_I10: valueFromI10 });
    }
    3. The script returns JSON which the flow passes back to the agent as text
    4. In the agent, parse the JSON to get each value into variables
     
    This handles multiple sheets cleanly, you just add more getWorksheet calls in the same script and return all values in one JSON object. No need for a separate flow call per sheet.
     
      Best regards,

    Valantis   ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/ 💼 LinkedIn ▶️ YouTube
  • Suggested answer
    Haque Profile Picture
    4,099 Super User 2026 Season 2 on at
    Hi @N962908,
     
    The core basic part has already been covered by @Valantis and @Robu1. 
     
    Before extractcing all excel sheet content in one Json and passing it to Agent, let's make sure excel file stored in SP has "Table" formatted sheets and the datea range is well defined. 
     
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
     
     
  • Valantis Profile Picture
    7,266 Super User 2026 Season 2 on at

    Hi @N962908,

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

     

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Copilot Studio

#1
Mohsin Ali Profile Picture

Mohsin Ali 254

#2
Dua Sadiq Profile Picture

Dua Sadiq 127

#3
sannavajjala87 Profile Picture

sannavajjala87 104 Super User 2026 Season 2

Last 30 days Overall leaderboard