1. Home
  2. Integrations
  3. Custom

Custom

See available data formats

The Custom option allows you to use Excel as a reference, enabling the integration flow to process files in .xls and .xlsx formats via EIP marshal.

In this case, the format converts the rows of the specified spreadsheet into a JSON array of objects, and the generated JSON object for each cell will contain, in addition to the value, metadata about the data type.

NOTE

The visual styles of the spreadsheet (cell color, font color, bold, borders, etc.) are not imported.

You can customize the conversion behavior using the headers (setHeader) SensediaExcelFormat and SensediaExcelSheetNames:

Header
Description
Required
Default value
SensediaExcelFormatDefines the file format: .xls or .xlsx. Other values will result in an error.No.xlsx
SensediaExcelSheetNamesList of sheet names to be processed, separated by commas.No-
IMPORTANT
  • Only the sheets listed in SensediaExcelSheetNames will be processed.
  • Non-existent sheet names in the spreadsheet will be ignored.
  • If the SensediaExcelSheetNames header is provided but no name matches an existing sheet, the component will return an error.
  • Formulas are supported, but invalid formulas will result in an error in the Excel cell.

JSON Format

After converting an Excel file to JSON, the data is organized as shown in the following JSON Schema:

Comparison between Excel and JSON

Now, compare an Excel spreadsheet with its JSON version:

Excel

JSON

Code Example

This flow exposes a REST endpoint (GET /teste-excel) that, when called, downloads an Excel file from an SFTP server, converts the content to JSON, and returns the result.

The processing occurs as follows:

Receives the GET request.

Logs the start of the file download via SFTP.

Downloads the file from the SFTP server.

Logs the completion of the download and the conversion to JSON.

Converts the content to byte[].

Sets in setHeader the sheet names to be processed (test1,test2).

Uses marshal with the data format excel (custom) to transform the file into JSON.

Sets the setHeader Content-Type as application/json for the response.

IMPORTANT

Excel can also be used in flows with EIP unmarshal (to transform JSON files into Excel).

  • In this case, the addr field of the input JSON will not be considered.
  • The assembly of rows and columns will be based only on the order of rows and cells.
  • The result of the unmarshal will be a byte[].

How happy are you with this page?

We use cookies to enhance your experience on our site. By continuing to browse, you agree to our use of cookies.Learn more