Share Point integration and write access for chat agent

What I’m Trying to Do

I have a custom Chat Agent connected to a SharePoint-based Space. The agent can read files in the knowledge base successfully. I now want the agent to also write new rows to a specific Excel file in SharePoint so that when the agent identifies something to log, it can write the entry directly to the spreadsheet without me having to do it manually.

This is a collaborative team SharePoint site (not a personal OneDrive/SharePoint), shared across the team.

What’s Working

  • The agent can read files in the knowledge base via the SharePoint connection

  • The agent has SharePoint write tools available (WriteRange, WriteCell)

  • The SharePoint connector/integration is set up

What’s Not Working

The agent’s SharePoint write tools require two identifiers to target the correct file:

  1. siteId — the unique identifier for the SharePoint site

  2. driveItemId — the unique identifier for the specific Excel file

The agent cannot resolve these IDs on its own from the knowledge base connection alone.

What I Need

  • How do I find the siteId for a collaborative team SharePoint site?

  • How do I find the driveItemId for a specific Excel file on that site?

  • Or: Is there a way to configure the agent/connector so it can discover these IDs automatically when writing to files in a connected SharePoint space?

Great question — you’re really close! I tested this out and can confirm what you’re running into. The SharePoint action connector’s write tools (WriteCell, WriteRange) do require those IDs, and the connector currently doesn’t include discovery tools to resolve them automatically from within the agent.

Here’s the workaround that works today:

You’ll need to grab the IDs manually one time, then hardcode them in your agent’s instructions.

Step 1 — Get your siteId:

Use the Microsoft Graph Explorer (https://developer.microsoft.com/graph/graph-explorer):

GET https://graph.microsoft.com/v1.0/sites/{your-tenant}.sharepoint.com:/sites/{your-site-name}

The id field in the response is your siteId.

Step 2 — Get your driveItemId:

Once you have the siteId:

GET https://graph.microsoft.com/v1.0/sites/{siteId}/drive/root:/{path/to/your-file.xlsx}

The id in the response is your driveItemId.

Step 3 — Configure your agent:

Add something like this to your agent’s instructions:

“When logging entries, use the SharePoint WriteRange action with siteId: your-site-id, driveItemId: your-drive-item-id, worksheetIdOrName: Sheet1. First call GetUsedRange to find where the data ends, then WriteRange to the next row to append.”

This way the agent doesn’t need to discover the file each time — it knows exactly where to write.

Re: automatic discovery — You’re right that it should work more seamlessly. The write tool descriptions actually reference discovery tools (ListSites, GetDriveItem) as prerequisites, but those aren’t currently exposed in the connector. I’ve filed a feature request with our service team to add SearchSiteDriveItems / ListSites / GetDriveItem actions to the SharePoint connector so agents can resolve file identifiers dynamically from a filename or path. Will update here when there’s movement on that.

TL;DR: For now, grab siteId and driveItemId via Graph Explorer and hardcode them in your agent prompt. It’s a one-time setup per file and works reliably. Longer term, the connector should let agents discover these IDs natively.

Hope that helps!

Thank you for your prompt response. I did run in to another blocker with Microsoft Graph explorer approval, I do not have access to Microsoft Graph Explorer, although i did find a work around to this. I am not sure if it’s intended to be that way or not but if you use Quick desktop for your chat agent and request write, it is capable of doing so. Wonder what feature enables it on desktop while blocks it on browser.

Hi @sysaads,

Hope everything is well! Glad you were able to work around that via Quick Desktop. Just wanted to check in and see if you had any other related questions in regard to your initial one. Please help the community by marking this answer as “Solution” or following up in general within the next 3 business days!

Thank you!

Hi @sysaads,

Since I haven’t received any further updates from you, I’ll treat this inquiry as complete for now. If you have any additional questions, feel free to create a new post in the community and link this discussion for context.

Thank you!