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.
type: "io.kestra.plugin.microsoft365.sharepoint.Export"Examples
Export a Word document to PDF
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
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
clientId *Requiredstring
Azure Client ID
The client ID registered in Azure
clientSecret *Requiredstring
Azure Client Secret
The client secret for the registered application
format *Requiredstring
HTMLPDFOutput format
The format to convert the file to. Supported values: 'pdf' or 'html'.
siteId *Requiredstring
Sharepoint Site ID
The id of the
tenantId *Requiredstring
Azure Tenant ID
The Azure Active Directory tenant ID
driveId string
Drive ID
The id of the document library within the SharePoint site. If not provided, the default document library will be used.
itemId string
Item ID
The ID of the file in SharePoint to export. Either itemId or itemPath must be provided.
itemPath string
Item path
The path to the file relative to the drive root (e.g., '/Documents/file.docx'). Either itemId or itemPath must be provided.
Outputs
format string
The format the file was converted to
itemId string
The ID of the file
name string
The name of the exported file with new extension
originalName string
The original name of the file in SharePoint
originalSize integer
The size of the original file in bytes (before conversion)
uri string
The URI of the file in Kestra's internal storage
webUrl string
The web URL of the file in SharePoint