L2 Construct: export_file
drive googleDescription
ExportFile exports a Google Drive file to a specific format. It takes the file ID, desired export extension, and a new file name as input. The function converts the file to the specified format and returns the exported file's ID, name, and URL. Currently supported export formats: gsheet (Google Sheets).
L2 Data
- Provider: google
- Module: gdrive
- Action: export_file
Example Step
{
"name": "insert-your-step-name",
"type": "l2",
"l2_data": {
"provider": "google",
"module": "gdrive",
"action": "export_file",
"metadata": {}
}
}
Input
Example
{
"file_id": "1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc",
"export_extension": "gsheet",
"export_file_name": "Monthly_Report_For_2024_Template"
}
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pontus.bpa/pkgs/l2/google/gdrive/export-file-input",
"$ref": "#/$defs/ExportFileInput",
"$defs": {
"ExportFileInput": {
"properties": {
"file_id": {
"type": "string"
},
"export_extension": {
"type": "string"
},
"export_file_name": {
"type": "string"
}
},
"additionalProperties": false,
"type": "object",
"required": ["file_id", "export_extension"]
}
}
}
Output
Example
{
"file_id": "1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc",
"export_file_name": "Monthly_Report_For_2024_Template",
"export_file_url": "https://drive.google.com/file/d/1EAYk18WDjIG-zp_0vLm3CsfQh_i8eXc67Jo2O9C6Vuc/view?usp=drive_link",
"error": {
"is_error": false
}
}
Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://pontus.bpa/pkgs/l2/google/gdrive/export-file-output",
"$ref": "#/$defs/ExportFileOutput",
"$defs": {
"ExportFileOutput": {
"properties": {
"file_id": {
"type": "string"
},
"export_file_name": {
"type": "string"
},
"export_file_url": {
"type": "string"
},
"error": {
"$ref": "#/$defs/HandlerError"
}
},
"additionalProperties": false,
"type": "object",
"required": ["file_id", "export_file_name", "export_file_url", "error"]
},
"HandlerError": {
"properties": {
"is_error": {
"type": "boolean"
},
"errors": {
"items": {
"type": "string"
},
"type": "array"
}
},
"additionalProperties": false,
"type": "object",
"required": ["is_error"]
}
}
}