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 / Copilot Search for tab...
Copilot Studio
Suggested Answer

Copilot Search for table data in Sharepoint files

(0) ShareShare
ReportReport
Posted on by 28
 
We have attached the sharepoint files as knowledge source to copilot, which have complex formatting and tables with merged cells .
The search works better with authentication option - Authentication with Microsoft but the same get impacted when we use Manual authentication - Entra Id with client secrets.
The first authentication can get answer correctly from tables as well.
We had to switch to Manual authentication as we have requirement to send the conversation starter message in language passed to the chatbot, we used this code as baseline to send the language through directline- CopilotStudioSamples/SSOSamples/SSOwithEntraID/index.html at main · microsoft/CopilotStudioSamples …
 
Is there a way we can achieve this even while using Authenticate with Microsoft?
 
Any suggestions would be really helpful.
I have the same question (0)
  • Suggested answer
    Nivedipa-MSFT Profile Picture
    Microsoft Employee on at
    ,Hello  .

    "Authenticate with Microsoft" leverages the user's own token to access SharePoint, resulting in better content extraction. In contrast, manual authentication uses an app-level token, which leads to a lower-quality search—especially with complex tables or merged cells.

    Recommended approach: Continue using "Authenticate with Microsoft" and pass the language parameter through Direct Line using channelData. When the conversation starts, send a custom event (such as setLanguage) and set up a Copilot Studio topic that is triggered by this event to store the language in a global variable. This variable can then be used for the conversation starter message.

    This method maintains high-quality SharePoint search results and supports multilingual needs, so there's no need to switch to manual authentication.

  • SK-11031031-0 Profile Picture
    28 on at
    Thank you for your help, we had same understanding but do you have any sample through which we can pass the language parameter through Direct Line using channelData, as mentioned above we did give this a try but it wasnt working for us. 
    Your help would be really appreciated.
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at
  • SK-11031031-0 Profile Picture
    28 on at
    Thank you for your response, but if you see my original question we are using this only, but here to connect to bot we need to have Token Endpoint which we get only when Manual Authentication is enabled. 
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at

    Hello  ,
    Retain manual authentication for the Token Endpoint, but include SSO token exchange so SharePoint queries continue to use the user's identity, ensuring the same quality as "Authenticate with Microsoft."

    Implementation: In your WebChat code, obtain a user token using MSAL, then intercept the OAuth card from Copilot and perform a silent token exchange:

    // Intercept OAuth card in store middleware
    if (activity.attachments?.[0]?.contentType === 'application/vnd.microsoft.card.oauth') {
        directLine.postActivity({
            type: 'invoke',
            name: 'signin/tokenExchange',
            value: { token: msalUserToken, connectionName: connectionName }
        }).subscribe();
    }

    This approach enables manual authentication at the Token Endpoint, language passing, and high-quality SharePoint search using user-delegated permissions through SSO. Be sure to configure the Token exchange URL in Copilot Studio's authentication settings and expose an API with the access_as_user scope in your Azure AD app registration.

  • SK-11031031-0 Profile Picture
    28 on at
     
    This is included in our code with Manual Authentication, but nothing helps.
    I find the results accuracy better with Authenticate with Microsoft but I am failing to get a way to pass data from the webchat UI to Copilot Agent. 
  • Nivedipa-MSFT Profile Picture
    Microsoft Employee on at
    Hello ,
    There's no need to pass the language manually—just use System.User.Language in Copilot Studio's Conversation Start topic. The browser locale is automatically detected, allowing you to keep "Authenticate with Microsoft" enabled for optimal search results without requiring DirectLine or Manual Auth.
    If you need to send custom data, use the __startConversationMessage query parameter in the embed iframe URL, ensuring that "Authenticate with Microsoft" remains enabled.
     
  • SK-11031031-0 Profile Picture
    28 on at
    We are integrating it into a custom application built on Appian which supports multiple langauges, and user would like to maintain the same language used in Appian rather than the user system language.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Copilot Studio

#1
Valantis Profile Picture

Valantis 600

#2
chiaraalina Profile Picture

chiaraalina 126 Super User 2026 Season 1

#3
deepakmehta13a Profile Picture

deepakmehta13a 116

Last 30 days Overall leaderboard