Skip to main content
February 19, 2024
Question

The json Text parameter was not valid JSON

  • February 19, 2024
  • 11 replies
  • 0 views

I am using a!fromJson to convert a JSON string into an Appian value. However, I encounter an error when handling document types.

This is the current format I am using:


in ER:  """" & fv!item & """:[" & substitute(if(rule!GLB_isBlank(local!data[fv!item]), "", local!data[fv!item]),";",",") & "]",

OUTPUT: "fieldName":[[Document:115497], [Document:115501]]



but It's giving error 'The json Text parameter was not valid JSON'

11 replies

harshitb6843
February 19, 2024

Try to wrap your local!data[item] into integer. This will give you just the numbers and it will become an integer array. 

"""" & fv!item & """:[" & substitute(
  if(
    rule!GLB_isBlank(local!data[fv!item]),
    "",
    tointeger(local!data[fv!item])
  ),
  ";",
  ","
) & "]"

February 19, 2024

getting this output  "fieldName" :[∞]

harshitb6843
February 19, 2024

Just a quick question. How are you getting this JSON? It looks like you are creating one by yourself. So why not directly use a!toJson on a map or dictionary?