Skip to main content

Locate a SharePoint/OneDrive Drive ID

The Jet Analytics file-based Enhanced data sources (CSV, Excel, and similar) can connect to files stored in SharePoint or OneDrive. Connecting requires four values from a service principal:

  • SharePoint/OneDrive Client ID
  • SharePoint/OneDrive Client Secret
  • SharePoint/OneDrive Tenant ID
  • SharePoint/OneDrive Drive ID

The Client ID, Client Secret, and Tenant ID come from the Azure App Registration. The Drive ID is less straightforward to locate — this article describes how to find it using the Microsoft Graph API via Postman.

For the general connection settings for file-based data sources, see Data Sources General Connection Settings.

Prerequisites — App Registration permissions

The service principal used for the connection requires the following Application permissions granted in Azure:

  • Files.Read.All
  • Sites.Read.All

To ensure sufficient access, you may also add Group.Read.All and User.Read.All.

Find the Drive ID using Postman

  1. Download and install Postman.
  2. Import the SharePoint Postman collection. Click Import in the upper-left corner of Postman and locate the collection file.
  3. In the collection variables, enter the known values: ClientId, ClientSecret, and TenantId. Leave SiteId and DriveId empty for now.
  4. Open the collection's Authorization tab and click Get New Access Token. Click Proceed, then Use Token.
  5. Run the Get Sites call. In the response, locate the SharePoint site that contains the files. Copy its id value and save it as the SiteId variable.
  6. Run the Get Drives call. In the response, find the drive with driveType: "documentLibrary" that corresponds to the document library containing the files. Copy its id value — this is the Drive ID to use in the data source connection.
    Note:

    A SharePoint site typically has multiple document libraries. The Drive ID for a specific custom library (for example, one named "Excel files") will differ from the Drive ID for the primary shared Documents library. Check the name field in each drive entry to identify the correct one.

Use the Drive ID obtained in step 6 in the SharePoint/OneDrive Drive ID field of the data source connection in the Jet Analytics Portal. The same Drive ID is also used when connecting to SharePoint Lists.

Was this article helpful?

We're sorry to hear that.