Skip to content

JSON Pretty Node

The JSON Pretty node is a functional component in FlowAI used to beautify and optimize JSON data display. By formatting the input JSON data, you can view and use this data more clearly in subsequent processes.

Node Configuration

Basic Settings

JSON Pretty Node Basic Settings

  1. Node Name

    • Set a descriptive name for the JSON Pretty node
    • Recommended to use names that reflect the data processing purpose, such as “Format User Data”, “Beautify Order Information”, etc.
    • Naming convention: Use verb + noun format, such as “Format Response Data”, “Beautify Log Content”
  2. JSON Data Source

    • Specify the source of JSON data that needs formatting
    • Supports selecting appropriate variables from previous node outputs as data sources
    • For example: start.data indicates getting data from a node named “start”
  3. Output

    • The formatted JSON data will be output as a new variable
    • For example: $JSONPretty1.output is used for reference in subsequent nodes

Usage Examples

1. JSON Data Formatting

Learn how to format JSON data in FlowAI through the following steps:

  1. Select JSON Pretty Node

    In the flow design interface, select “JSON Pretty” from the “Data Processing” section.

  2. Configure Node

    Node Name: JSONPretty1
    JSON Data Source: Start.data
    Output: $JSONPretty1.output

    JSON Pretty Configuration

  3. Connect to Content Combiner

    Connect the formatted JSON data to the “Content Combiner” node for better display:

    Node Name: ContentCombiner1
    Content:
    ```json
    $JSONPretty1.output
    ```

    Content Combiner Configuration

  4. Output

    Output Node Configuration

2. Combining with Other Processing Nodes

Formatted JSON data can be further processed in other nodes, such as parameter extraction or data analysis.

Advanced Usage

1. Multi-level JSON Data Processing

When handling complex multi-level JSON data, the Pretty node can help you understand the data structure more intuitively, making it easier to extract specific fields or perform conditional judgments.

2. Combined Node Usage

You can combine the JSON Pretty node with other data processing nodes to achieve more complex workflows, for example:

[JSON Pretty] --> [JSON Parameter Extraction] --> [Conditional Logic] --> [Content Combiner]

Best Practices

  1. Clear Formatting Purpose

    • Ensure clear use cases for Pretty nodes, avoid unnecessary performance overhead
    • Use Pretty nodes when display or further processing is needed
  2. Variable Management

    • Properly name output variables for easy reference in subsequent nodes
    • Ensure correct variable paths to avoid data source errors
  3. Debugging and Optimization

    • Use content combiner nodes to output formatting results for debugging
    • Consider JSON data size and complexity to optimize processing flow

Common Issues

Through proper use of the JSON Pretty node, you can significantly improve the readability and efficiency of data processing. Ensure correct configuration of data sources and output variables in the workflow to achieve automated and precise data management.