Member Junction
    Preparing search index...

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

    // 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
    Index

    Constructors

    Methods

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

      Parameters

      • params: RunActionParams

        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

    • Reads Excel files and converts to JSON

      Parameters

      • params: RunActionParams

        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

      Returns Promise<ActionResultSimple>

      Promise resolving to the action result

    • Save file to MJ Storage. Uploads the content to a FileStorageAccount and creates the corresponding MJ: Files entity record.

      Parameters

      • content: string | Buffer

        File content as string or Buffer

      • fileName: string

        Name for the file

      • mimeType: string

        MIME type of the file

      • params: RunActionParams

        Action parameters (for contextUser)

      • OptionalstorageAccountName: string

        Optional: name of the storage account to use (falls back to first active)

      • OptionalstoragePath: string

        Optional: custom storage path prefix (falls back to artifacts/{date}/{uuid}/)

      Returns Promise<string>

      The ID of the newly created MJ: Files record