All articles

Data 360

Fixing SharePoint document retrieval in Agentforce

Your SharePoint connection works, but Agentforce cannot find the file. Check ingestion, library scope, retrieval, and user access in that order.

The SharePoint connection test passes. You ask Agentforce about a policy in that site, and it has no answer.

Start by looking for the file in Data 360. A working connection tells you that Salesforce can authenticate; you still need to check whether it imported the document and whether the retriever can find the right passage.

Pick one approved document and a question it should answer. Follow that file through the steps below before changing the agent’s prompt.

Check which SharePoint connector you’re using

Salesforce has separate connectors for structured SharePoint data, uploaded documents, and site pages. For files such as policy documents, use the Microsoft SharePoint Unstructured Documents connector. A policy written directly on a SharePoint page needs the appropriate site-page route instead.

Find the original file and note its site, library, and last modification time. A link on a site’s home page may point somewhere else. The location of the file matters more than the page someone clicked to reach it.

Look for the file in the ingestion results

Your Microsoft administrator will need to configure the application registration and its access to the intended sites. Salesforce documents the Microsoft prerequisites and connection setup.

With the connection working, create an unstructured data lake object (UDLO) from External Files, select the SharePoint connection, and choose the site and data space. Follow the UDLO setup instructions for mapping and semantic-search settings.

After ingestion, find your test file in the results. If it’s missing, check Sync Status and Sync Status Detail. A completed job can still import no records.

The connector limitations are worth checking early:

  • The connector reads the configured site’s default Documents library. Subsites and non-default libraries aren’t included.
  • It doesn’t offer folder-level selection within that library.
  • Files can be skipped because of format, size, or age, including the documented two-year last-modified cutoff.

Those restrictions can explain why a connection works while a particular policy never arrives. Don’t edit a policy merely to change its timestamp; have its owner review the content first.

Test the retrieved passage before the agent’s answer

Once the file is present, check that the search index includes it and inspect the generated chunks. Ask the test question against the retriever and read the passage it returns.

If it returns the wrong passage, investigate the source documents, chunking, and retrieval settings. If it returns the correct passage but the agent gives a wrong answer, inspect the instructions used to produce that answer. These are different places to make a fix.

To use your own retriever, activate it, select it in an Agentforce Data Library using Custom Retriever, and connect the library to the agent. Salesforce’s custom retriever guide covers that connection. This searches content already ingested into Data 360, so a recent SharePoint edit may not be available immediately.

Check access and updates before adding more documents

Test with someone who should see the policy and someone who shouldn’t. Inspect the retrieved context as well as the answer. Instructions telling the agent to refuse a request don’t replace controls that prevent restricted text from reaching the model.

The custom retriever documentation also distinguishes static pre-filters from approaches that pass runtime values. Confirm how your chosen path enforces each user’s access; don’t assume it inherits every SharePoint permission automatically.

Finally, update the test file and check when the new passage appears. Test removal too, and open its citation as the intended reader. Expand the library when that reader can get the correct, current answer and verify it at the source.

Keep reading

All articles