PDF4me icon

PDF4me

Comprehensive PDF and document processing: generate barcodes, convert files, extract data, manipulate images, and automate workflows with the PDF4ME API

Actions80

Overview

The node converts JSON data into an Excel spreadsheet file. It supports multiple input formats for the JSON data, including raw JSON strings, binary files containing JSON, and base64-encoded JSON strings. This flexibility allows users to convert structured JSON data from various sources into a well-formatted Excel document.

Common scenarios where this node is beneficial include:

  • Exporting API response data or database query results in JSON format into Excel for reporting or analysis.
  • Transforming JSON logs or event data into Excel sheets for easier visualization.
  • Converting JSON configuration or data files into Excel for sharing with non-technical stakeholders.

Practical example:

  • A user receives JSON data from a webhook and wants to generate an Excel report automatically. They can feed the JSON string directly or use a previous node's binary JSON file as input, specify worksheet and formatting options, and get an Excel file ready for download or further processing.

Properties

Name Meaning
Input Data Type Choose how to provide the JSON data to convert. Options: "JSON String", "Binary Data" (JSON file from previous node), "Base64 String" (base64 encoded JSON content).
JSON Content The JSON data to convert to Excel, provided as a JSON string. Used when Input Data Type is "JSON String".
Input Binary Field Name of the binary property that contains the JSON file. Used when Input Data Type is "Binary Data".
Base64 JSON Content Base64 encoded JSON content. Used when Input Data Type is "Base64 String".
Output File Name Name for the output Excel file (e.g., "converted_data.xlsx").
Document Name Name of the output document for reference purposes.
Worksheet Name Name of the Excel worksheet inside the file (default "Sheet1").
Advanced Options Collection of optional advanced settings:
- Convert Numbers and Dates Whether to automatically convert numbers and dates in the JSON data.
- Custom Profiles JSON string to set custom profiles for API calls, allowing extra options for conversion.
- Date Format Date format pattern for Excel cells (e.g., "MM/dd/yyyy").
- First Column Starting column number (1-based) in the Excel sheet.
- First Row Starting row number (1-based) in the Excel sheet.
- Ignore Null Values Whether to ignore null values in the JSON data during conversion.
- Number Format Number format code for Excel cells. Options include General, Number with decimals, Currency, Percentage, Scientific, Date/Time formats, etc.
- Title Bold Whether to make the title row bold.
- Title Wrap Text Whether to wrap text in title cells.

Output

The node outputs an Excel file (.xlsx) containing the converted data from the input JSON. The output includes:

  • A JSON object with metadata about the generated Excel document.
  • A binary property containing the actual Excel file data, named according to the specified output file name.

This Excel file can be downloaded, saved, or passed to subsequent nodes for further processing.

Dependencies

  • Requires an API key credential for the PDF4me service or similar backend that performs the JSON to Excel conversion.
  • The node relies on external API calls to convert JSON data into Excel format.
  • Proper configuration of authentication credentials in n8n is necessary for successful execution.

Troubleshooting

  • Invalid JSON input: If the JSON content is malformed or invalid, the node will throw an error. Ensure the JSON string or file is correctly formatted.
  • Incorrect binary property name: When using binary data input, specifying the wrong binary field name will cause the node to fail to find the JSON file. Verify the binary property name matches the previous node's output.
  • API authentication errors: Missing or incorrect API credentials will result in authorization failures. Check that the API key or token is properly configured.
  • Unsupported date or number formats: Using unsupported or incorrect format codes in advanced options may lead to unexpected formatting in Excel. Use documented format codes.
  • Large JSON data: Very large JSON inputs might cause timeouts or memory issues depending on the backend service limits.

Links and References

Discussion