Skip to main content
Known Participant
Feb 19, 2024 9:46 AM UTC
Question

The json Text parameter was not valid JSON

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
Brainy
Feb 19, 2024 9:54 AM UTC

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])
  ),
  ";",
  ","
) & "]"

Known Participant
Feb 19, 2024 10:16 AM UTC

getting this output  "fieldName" :[∞]

harshitb6843
Brainy
Feb 19, 2024 10:18 AM UTC

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?