For the complete documentation index, see llms.txt. This page is also available as Markdown.

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

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

Parameters

Parameter
Description
Required

String to Check

The string to validate.

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

Usage

Example 1: Providing a valid JSON string

Input:

{"test":"test"}
Example 2: Providing a invalid JSON string

Input:

I am not a JSON string!

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:

Return from Example 2:

Last updated

Was this helpful?