KB-1243 "The jsonText parameter of a!fromJson() was not valid JSON" error thrown when executing a!fromJson() querying a JSON object with a null value

Symptoms

An expression rule cannot evaluate a!fromJson() for a JSON object that contains a null value. The following error is seen:

Expression evaluation error at function a!fromJson: 

Error evaluating function fn!fromjson_appian_internal : The jsonText parameter of a!fromJson() was not valid JSON. Received: {"value":[null,null]}.

Cause

The JSON string contains an invalid value that cannot be parsed (in this case “null”).

Action

In Appian, “” should be used to represent a null value that is to be pushed to a JSON object instead using the literal “null” or null(). E.g.:

{"value":[“”,“”)]}

Affected Versions

This article applies to all versions of Appian.

Last Reviewed: March 2017

Related
Recommended