The json Text parameter was not valid JSON

Certified Senior Developer

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'

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Senior Developer
    in reply to Harshit Bumb (Appyzie)

    a!localVariables(
      local!data: rule!xxxxxx(
        Id: 8
      ).data[1],
      local!keys: dictutil_getkeys(
        local!data
      ),
      local!listOfDifferences: a!forEach(
        items: local!keys,
        expression: if(fv!item = "yyyyy",
        """" & fv!item & """:[" & substitute(if(rule!GLB_isBlank(local!data[fv!item]), "", tointeger(local!data[fv!item])),";",",") & "]",
        """" & fv!item & """:""" & local!data[fv!item] & """"
        )
      ),
      a!fromJson(
        "{" & joinarray(
          local!listOfDifferences,
          ","
        ) & "}"
      )
    )

Children