1001fx - NoCode functions icon

1001fx - NoCode functions

1001fx is a set of functions for any automation platform. Our functions are simple, very well tested, scalable and offer features that most automation platforms do not offer.

Actions74

data → Stringify a JSON Object

AI-generated

Overview

This node provides a "Stringify a JSON Object" operation under the "data" resource. It converts a given JSON object into its string representation, optionally formatting it for readability and allowing selective property inclusion via a replacer. This is useful when you need to serialize data for storage, transmission, or logging within your n8n workflows.

Common scenarios:

  • Preparing JSON data for APIs that require stringified payloads.
  • Logging or storing complex objects as strings.
  • Selectively serializing only certain properties of an object.

Example:
You have a workflow where you receive a JSON object from one system and need to send it as a string to another API endpoint.


Properties

Name Meaning
JSON Input The value to convert to a JSON string.
Spacing A number (0–10) used to insert white space into the output JSON string for readability (pretty-printing).
Replacer Input Mode Choose how to specify which properties to include in the output:
- Expression
- Manual
Replacer An array of strings/numbers specifying which properties of the input value to include in the output.
Shown as JSON (Expression) or as list (Manual).

Output

  • json:
    • If successful, contains a single field with the stringified JSON result.
      {
        "result": "{\"key\":\"value\"}"
      }
      
    • If an error occurs, contains an error field with details:
      {
        "error": "Error message or details"
      }
      

Dependencies

  • External Service: Requires access to the 1001fx API.
  • API Key: Needs valid credentials (1001fxApi) configured in n8n.
  • n8n Configuration: Ensure the credential is set up and assigned to this node.

Troubleshooting

Common Issues:

  • Invalid JSON Input: If the provided JSON is malformed, the node may return an error in the output.
  • Missing Required Fields: Omitting required fields like "JSON Input" will cause the node to fail.
  • API Credential Errors: Incorrect or missing API credentials will prevent the node from working.

Error Messages:

  • "error": "Unexpected token ..." — Indicates invalid JSON input; check your JSON syntax.
  • "error": "Request failed with status code 401" — Authentication issue; verify your API key.
  • "error": "Cannot read property '...' of undefined" — Likely due to missing or misconfigured input properties.

How to resolve:

  • Double-check your input JSON for correctness.
  • Ensure all required properties are filled.
  • Verify your 1001fx API credentials in n8n.

Links and References

Discussion