# Is JSON transform action

## Use case

You are working with an API and the return comes back as a JSON string instead of being a JSON object. You would like to verify that the string is valid JSON before attempting to convert it to JSON.

## Overview

<figure><img src="https://1835401289-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FAQQ1EHVcEsGKBPVHmiav%2Fuploads%2FYCMe79FK7muyICki6qLz%2FScreenshot%202025-03-28%20at%2011.22.11%E2%80%AFAM.png?alt=media&#x26;token=6148ddc7-a58f-4099-8791-d988d9bb6594" alt=""><figcaption></figcaption></figure>

This transform will check whether or not a string provided via the 'String to Check' input is a valid JSON string.

## Parameters

<table><thead><tr><th width="217">Parameter</th><th width="417.3333333333333">Description</th><th data-type="checkbox">Required</th></tr></thead><tbody><tr><td>String to Check</td><td>The string to validate.</td><td>true</td></tr></tbody></table>

{% hint style="info" %}
This transform is useful for confirming a string is a valid JSON string prior to converting it to json using a filter such as `|json`
{% endhint %}

## Usage

<details>

<summary>Example 1: Providing a valid JSON string</summary>

Input:

```
{"test":"test"}
```

</details>

<details>

<summary>Example 2: Providing a invalid JSON string</summary>

Input:

```
I am not a JSON string!
```

</details>

## Results output

\
This transform will output a boolean value (True/False) based on whether or not the string is a valid JSON string.

Return from Example 1:

```json
True
```

Return from Example 2:

```json
False
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rewst.help/documentation/automations/actions-in-rewst/transform-actions/is-json-transform-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
