> For the complete documentation index, see [llms.txt](https://university.gonexa.fr/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://university.gonexa.fr/connect/en/getting-started/configure-connect-sharepoint/configure-salesforce.md).

# Set up Gonexa Connect in Salesforce

From your Salesforce Setup, go to Permission Sets and click New.

## Create a permission set in Salesforce

From your Salesforce Setup, go to Permission Sets and click New.

* Label: FilesConnect
* API Name: FilesConnect

Save

In the System section of your permission set

* Click System Permissions
* Click Edit
* Search for Files Connect Cloud
* Check the Enabled box and save
* Save the confirmation of the permission changes
* On the same page, click Manage Assignments
* Then click Add Assignments
* Change the list view to see all users and check those you want to assign the rights to (including yourself)
* Click Next, then Assign

## Creating an authentication provider

From Salesforce Setup, go to Auth. Providers.

Click New

* **Provider Type**: Open Id Connect
* **Name**: Sharepoint
* **URL Suffix**: Sharepoint
* **Consumer Key:** paste the consumer ID *(previously found in the Overview tab, in the Application (client) ID section in SharePoint)*
* **Consumer Secret**: paste the secret *(previously found in SharePoint under Certificates & secrets, in the Client secrets tab. Copy the code from the Value column.)*
* Authorize Endpoint URL: `https://login.microsoftonline.com/common/oauth2/authorize?resource=https%3A%2F%2FYOUR_TENANT.sharepoint.com&prompt=login`\
  (Replace YOUR\_TENANT with the name of your SharePoint, e.g. Gonexa: `https://login.microsoftonline.com/common/oauth2/authorize?resource=https%3A%2F%2FGONEXA.sharepoint.com&prompt=login`)
* Token Endpoint URL: `https://login.microsoftonline.com/common/oauth2/token`
* User Info Endpoint URL: (empty)
* Token Issuer: (empty)
* Default Scopes: (empty)
* Send access token in header: Checked
* Include Consumer Secret in SOAP API Responses: Checked
* Custom Error URL: (empty)
* Custom Logout URL: (empty)
* Registration Handler: (empty)
* Execute Registration As: (empty)
* Portal: (empty)
* Icon URL: (empty)

Save

## Redirect URL

Retrieve the Callback URL available in the Salesforce Configuration block after saving the SharePoint authentication provider.

E.g. `https://gonexa.my.salesforce.com/services/authcallback/Sharepoint`

In the Redirect URIs section, from the Overview in the Azure portal, click Add a Redirect URI.

* Click + Add a platform
* Select WEB
* In the Redirect URI section, paste the callback URL you retrieved from the SharePoint authentication provider.
* Click Configure

## Creating an external data source

{% hint style="warning" %}
This step must be performed by a Salesforce user who has access to the SharePoint application that was created, for example its owner. When the configuration is saved, they will need to log in to SharePoint with their username and password.
{% endhint %}

From Salesforce Setup, go to External Data Sources. Click New External Data Source.

* **External Data Source**: Sharepoint
* **Name**: Sharepoint
* **Type:** Files Connect > Microsoft SharePoint Online
* **Site URL:** From SharePoint, copy the first part of the URL *(e.g. `https://gonexa.sharepoint.com/sites/MonSite/`)* including the site name, and paste it here.
* **Identity Type:** Per User
* **Authentication Protocol:** OAuth 2.0
* **Authentication Provider:** Select Sharepoint
* **Scope:** (empty)
* **Administrative Authentication Status:** Pending
* **Start Authentication Flow on Save:** checked

Save and log in to your SharePoint with your username and password to validate this step.

{% hint style="warning" %}
This step cannot be bypassed. If administrator approval is required, refer to the #Adding permissions step. Your SharePoint administrator must grant you admin consent in the API permissions tab.
{% endhint %}

## Validate and sync the SharePoint data source

From Salesforce Setup

* Go to the external data source: Sharepoint
* Click Validate and Sync on the external data source
* From the page: Validate External Data Source: Sharepoint.
* Select the items\_Sharepoint table
* Click Sync

## Enable access to the SharePoint external data source

* Go to Permission Sets and select Files Connect
* In the Apps section, go to Object Settings
* Search for items-Sharepoint and open it
* In the Field Permissions section, check all Read Access boxes.
* In the Object Permissions section, check the Enabled box
* From the Files Connect permission set page, in the Apps section, go to External Data Source Access
* Click Edit
* Move Sharepoint to the Enabled External Data Sources and save.

## Create a custom setting

From Salesforce Setup, go to Custom Settings.\
Find the Sharepoint row and click Manage.\
Click New in the first section to create the default custom setting at the organization level.

* **Client Id**: {Paste the consumer ID found in the SharePoint Overview tab under Application (client) ID}
* **Client Secret:** *(previously found in SharePoint, under Certificates & secrets, in the Client secrets tab, on the Gonexa Connect row. Copy the code from the Value column.)*
* **Default path**: This is the SharePoint path where the generated file is stored\
  This field therefore controls the storage location of all documents stored in the platform's SharePoint. You can leave it empty if you want to set a path per template. Otherwise, enter the path as is: /FolderName\
  E.g. Quotes/2022/CustomerA

{% hint style="info" %}
This is the default storage location of the generated file, but you can control it from the template or from the flow action.
{% endhint %}

* **Site id**: SharePoint ID (required)

{% hint style="info" %}
The SharePoint ID is found at the URL of your SharePoint site followed by /\_api/site/id\
*E.g.* `gonexa.sharepoint.com/sites/Salesforce/_api/site/id` From the XML code displayed, retrieve the ID.
{% endhint %}

* **Tenant id**: Previously found in SharePoint. This is the Directory (tenant) ID, found in the Overview
* **Library**: *enter the name of the library in which to store the document, if there is one; otherwise leave it empty and the documents will be stored in Documents.*\
  e.g. GonexaConnect

Save


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://university.gonexa.fr/connect/en/getting-started/configure-connect-sharepoint/configure-salesforce.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
