Export a SharePoint file to another format

Exports a single file from SharePoint (e.g., Office document) to another format such as PDF or HTML using Microsoft Graph API.

yaml
type: "io.kestra.plugin.microsoft365.sharepoint.Export"

Export a Word document to PDF

yaml
id: microsoft365_sharepoint_export_file
namespace: company.team

tasks:
  - id: export
    type: io.kestra.plugin.microsoft365.sharepoint.Export
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    siteId: "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
    driveId: "b!Xyz123..."
    itemId: "01ABCDEF123456789"
    format: "pdf"

Export an Excel file to PDF

yaml
id: microsoft365_sharepoint_export_excel
namespace: company.team

tasks:
  - id: export
    type: io.kestra.plugin.microsoft365.sharepoint.Export
    tenantId: "{{ secret('AZURE_TENANT_ID') }}"
    clientId: "{{ secret('AZURE_CLIENT_ID') }}"
    clientSecret: "{{ secret('AZURE_CLIENT_SECRET') }}"
    siteId: "contoso.sharepoint.com,2C712604-1370-44E7-A1F5-426573FDA80A,2D2244C3-251A-49EA-93A8-39E1C3A060FE"
    itemPath: "/Documents/report.xlsx"
    format: "pdf"
Properties

Azure Client ID

The client ID registered in Azure

Azure Client Secret

The client secret for the registered application

Possible Values
HTMLPDF

Output format

The format to convert the file to. Supported values: 'pdf' or 'html'.

Sharepoint Site ID

The id of the

Azure Tenant ID

The Azure Active Directory tenant ID

Drive ID

The id of the document library within the SharePoint site. If not provided, the default document library will be used.

Item ID

The ID of the file in SharePoint to export. Either itemId or itemPath must be provided.

Item path

The path to the file relative to the drive root (e.g., '/Documents/file.docx'). Either itemId or itemPath must be provided.

The format the file was converted to

The ID of the file

The name of the exported file with new extension

The original name of the file in SharePoint

The size of the original file in bytes (before conversion)

The URI of the file in Kestra's internal storage

The web URL of the file in SharePoint