Skip to main content

Export to JSON file

This node saves data to a JSON file.

The Export to JSON file (Write To Json) node allows you to download an array or object as a file.

The Export to JSON file node takes an array (or object) and triggers a browser download of that data formatted as a JSON file. This is useful for backing up data, exporting reports, or saving user configurations.

Inputs​

Data​

DataDescription
ArrayThe data to export. Can be an array or an object.

Control​

SignalDescription
DoTriggers the export process.

Outputs​

Control​

SignalDescription
DoneTriggered when the download starts.

Status​

DataDescription
File PathThe name of the downloaded file (e.g., ).
ErrorError message if the export fails.

Usage​

Backup Data​

  1. Fetch all records from a database using Filter Records.
  2. Connect the Items array to the Array input of this node.
  3. Add a "Export" button.
  4. Connect Button Click to Do.
  5. The user will be prompted to save the file.

Detailed Behavior​

  • Environment:
    • Browser: Creates a Blob and triggers a programmatic click on a hidden link to start the download.
    • Node.js: Writes the file to the local filesystem.
  • Formatting: The JSON is pretty-printed with 2-space indentation for readability.

Troubleshooting​

  • Popup Blocked: Some browsers might block the download if it's not triggered directly by a user action. Ensure the Do signal comes from a click event.