> ## Documentation Index
> Fetch the complete documentation index at: https://help.nextmatter.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Integrate with SharePoint

> You can create and populate a folder in Sharepoint.

## Before you begin

<Accordion title="Prepare to connect to Microsoft">
  As part of the integration, you need to allowlist the Next Matter domain and create a service account. [See if you've completed all the required steps](/docs/integrate-with-microsoft).
</Accordion>

<Accordion title="I want to share folders or files, create folders, or upload files without any code">
  You can do it using SharePoint no-code steps. For details, see [Connect to Sharepoint no-code](/docs/connect-to-sharepoint-no-code)
</Accordion>

<Accordion title="I want to use advanced integration to create a SharePoint list or add a list item">
  * Since you can replace placeholders with a data reference of the data provided in one of the previous steps, learn more about [Data references](/docs/use-data-references).
  * Get your SharePoint SITE ID. You'll need it in the step configuration. To get the ID:

  1. Sign in to [https://developer.microsoft.com/graph/graph-explorer](https://developer.microsoft.com/graph/graph-explorer).
  2. Select GET as the method, and provide the following URL: `https://graph.microsoft.com/v1.0/sites/HOSTNAME.sharepoint.com:/sites/SITENAME`. The hostname might be, for example, *nextmatter.sharepoint.com*. You can find the site name in Sharepoint by clicking the **Settings** gear and clicking **Site Information**.
  3. View the JSON response for the value of the **id** parameter. The value is built up of 3 data bits: `HOSTNAME, SITE_ID, WEB_ID`. Copy the `SITE_ID` number string.

  ## Create a list in SharePoint (spreadsheet)

  1. In your Next Matter process, click **+Add step** and select **Integration > Custom integration**.
  2. Click **Settings** to configure the step.
  3. Enter the following details:
     * **Authorization**: Microsoft Sharepoint
     * **Method**: POST
     * **URL**: `https://graph.microsoft.com/v1.0/sites/SITE_ID/lists`
     * **Headers**: Content-Type: application/json
     * In the **Body** enter the list values. For example, the body might look like the following.

       ```json theme={null}
       {
                "displayName": "LIST_TITLE", //this is a placeholdder
                "columns": [
                  {
                    "name": "COLUMN_A",//this is a placeholdder
                    "text": { }
                  },
                  {
                    "name": "COLUMN_B",//this is a placeholdder
                    "number": { }
                  }
                ],
                "list": {
                  "template": "genericList"
                }
              }
       ```
  4. Create a variable for the list ID with the following value: `$.id`.
  5. Save your changes.

  ## Create a list item (row of data)

  1. In your Next Matter workflow, click **+Add step** and select **Integration > Custom integration**.
  2. Click **Settings** to configure the step.
  3. Enter the following details:
     * **Authorization**: Microsoft Sharepoint
     * **Method**: POST
     * **URL**: `https://graph.microsoft.com/v1.0/sites/SITE_ID/lists/LIST_ID/items`
     * **Headers**: Content-Type: application/json
     * In the **Body** enter the list values. For example, the body might look like the following.

       ```json theme={null}
       {
         "fields": {
           "Title": "TEST",//this is a placeholdder
           "textfield1": "NEW_TEXT",//this is a placeholdder
           "numberfield1": 0
         }
       }
       ```

  <Accordion title="Find the list ID">
    1) Open the SharePoint list.
    2) Click **List Settings**.
    3) Go to the page URL and copy the text after `List=`
  </Accordion>

  4. Save your changes.
</Accordion>
