Action that reads Excel files and converts them to JSON format Supports multiple sheets, ranges, and various data types

Example

// Read entire Excel file
await runAction({
ActionName: 'Excel Reader',
Params: [{
Name: 'FileURL',
Value: 'https://example.com/data.xlsx'
}]
});

// Read specific sheet with headers
await runAction({
ActionName: 'Excel Reader',
Params: [{
Name: 'FileID',
Value: 'uuid-of-excel-file'
}, {
Name: 'SheetName',
Value: 'Sales Data'
}, {
Name: 'HasHeaders',
Value: true
}]
});

// Read specific range
await runAction({
ActionName: 'Excel Reader',
Params: [{
Name: 'ExcelData',
Value: base64ExcelData
}, {
Name: 'Range',
Value: 'A1:D10'
}]
});

Hierarchy

  • BaseFileHandlerAction
    • ExcelReaderAction

Constructors

Methods

  • Reads Excel files and converts to JSON

    Parameters

    • params: RunActionParams<any>

      The action parameters containing:

      • FileID: UUID of MJ Storage file (optional)
      • FileURL: URL of Excel file (optional)
      • ExcelData: Base64 encoded Excel data (optional)
      • SheetName: Specific sheet name to read (optional, default: first sheet)
      • SheetIndex: Sheet index (0-based, alternative to SheetName)
      • Range: A1 notation range like 'A1:D10' (optional)
      • HasHeaders: Boolean - first row contains headers (default: true)
      • DateFormat: How to format dates - 'ISO' | 'Excel' | 'Local' (default: 'ISO')
      • EmptyCellValue: Value to use for empty cells (default: null)
      • IncludeHidden: Include hidden rows/columns (default: false)

    Returns Promise<ActionResultSimple>

    Array of objects (if headers) or array of arrays

  • Executes the action with the provided parameters.

    Parameters

    • params: RunActionParams<any>

      The action execution parameters including context

    Returns Promise<ActionResultSimple>

    Promise resolving to the action result

  • Get file content from various sources based on parameters Priority: FileID > FileURL > Data parameter

    Parameters

    • params: RunActionParams<any>

      Action parameters

    • dataParamName: string

      Name of the parameter containing direct data

    • fileParamName: string = 'FileID'

      Name of the parameter containing file ID (default: 'FileID')

    • urlParamName: string = 'FileURL'

      Name of the parameter containing file URL (default: 'FileURL')

    Returns Promise<{
        content: string | Buffer;
        fileName?: string;
        mimeType?: string;
        source: "url" | "storage" | "direct";
    }>

    Object with content and metadata