---
title: "stringify · RUAL Documentation"
description: "uses JSON.stringify to produce a string of the given data"
canonical: https://docs.rual.nl/block-types/value/value_json_stringify_v2
language: en
---

# stringify

This block is part of the [`value`](https://docs.rual.nl/block-types/value) group and was last modified in core [`v13.0.4`](https://docs.rual.nl/core-versions/130004).

uses JSON.stringify to produce a string of the given data

- Value required `value`

- Number required `number`

- Object required `object`

- Condition required `condition`

- Array required `array`

- spacing required `number`

- stringified `value`

Serializes the FIRST non-nil input among the typed pins (spacing excluded) to a JSON string; when every input is nil it outputs "{}". spacing greater than 0 pretty-prints with that many spaces of indentation. If serialization fails it outputs the literal string "null" instead of erroring.

| `json string` |
| --- |
| `stringify` |

A typical wiring for [stringify](https://docs.rual.nl/block-types/value/value_json_stringify_v2): [select field values](https://docs.rual.nl/block-types/array/array_get_values_from_bp_field) feeds the `array` pin; [search](https://docs.rual.nl/block-types/storage/function_search) feeds the `json` pin; [Request: POST json](https://docs.rual.nl/block-types/webhooks/function_trigger_webhook_http_post) feeds the `number` pin; the `stringified` out pin feeds [set](https://docs.rual.nl/block-types/redis/function_redis_cache_set_key).

![Studio canvas example for the stringify block: typical wiring for stringify.](https://docs.rual.nl/canvas-examples/value_json_stringify_v2.png)

### Commonly used with

In production blueprints, this block is most often wired together with:

- [set](https://docs.rual.nl/block-types/redis/function_redis_cache_set_key): this block feeds into it. Set key to hold the string value. If key already holds a value, it is overwritten, regardless of its type.

- [select field values](https://docs.rual.nl/block-types/array/array_get_values_from_bp_field): feeds into this block. returns an array with values of the given field in this array of objects.

- [return](https://docs.rual.nl/block-types/function%20execution/function_return): this block feeds into it. Returns the added custom pins as data-pins on the function execute.

- [search](https://docs.rual.nl/block-types/storage/function_search): feeds into this block. searches in the given storage based on a query.

- [Request: POST json](https://docs.rual.nl/block-types/webhooks/function_trigger_webhook_http_post): feeds into this block. Performs an HTTP POST request to create or submit data to the specified URL with a JSON body.

- [get fields](https://docs.rual.nl/block-types/object/object_field_getter_multiple): feeds into this block. Gets the selected fields from the given object.

### Version history

Introduced in [`v13.0.4`](https://docs.rual.nl/core-versions/130004).
