Node Inputs

The node accepts the following inputs:

  • key: A string representing the key in the JSON object where the value will be added or updated. For example, if you want to change the name property in a JSON, you would provide “name” as the key.

  • json_string: A stringified JSON that you want to update. This is the original JSON data that is written in a string format before any changes are made.

  • json_value: The value you want to add or update in the JSON data. This can be a new value or an updated value for an existing key. It can be a string representing a JSON object, a JSON array, or just a plain string.

Node Output

The node produces the following output:

  • updated_json_string: After the node finishes processing the inputs, it outputs a stringified JSON with the updates. This is the new version of the original JSON string, now containing the changes made by adding or updating the value for the specified key.

Node Functionality

The WriteJsonValue node is used to modify JSON data. It takes a stringified JSON and a key-value pair as inputs. You can use it to insert a new value into a JSON object or update an existing value by providing the correct key. The node processes the input and returns the updated JSON string.

When To Use

You can use the WriteJsonValue node whenever you need to manipulate JSON data within an automated process, such as updating configuration settings, modifying response data from an API, or just to ensure certain data fields contain up-to-date information before passing the JSON on to another process or system. This node simplifies tasks that involve the dynamic updating of JSON content without requiring you to write custom code or manually edit JSON strings.