Skip to main content
puneetk0004
February 10, 2023
Question

JSON in a JSON

  • February 10, 2023
  • 8 replies
  • 0 views

I am trying to add JSON object inside a JSON object but the generated JSON is not in the correct format. The child json is in double quotes. 

How can I get rid of these double quotes? Can someone help me with a correct substitute() function command?


8 replies

harshitb6843
February 10, 2023

Are you trying to generate it via Appian expressions?

puneetk0004
February 10, 2023

Hey Harshit, I am working under expression mode and below is what I wrote to achieve

local!dataPerfect:a!toJson( {"testifact_info":a!toJson(
{"testsuite_name":local!testSuiteName,
"testsuite_owner":local!testSuiteOwner,
"testsuite_description":local!testSuiteDescription,
"test_report_path":local!testReportPath,
"variable_map_external": local!variableMapPath,
"object_map_external":local!objectMapPath }) } ),

and then I am printing the dataPerfect variable in a richtext block

harshitb6843
February 10, 2023

For me, it is generating a valid JSON. You can try validating your JSON here - jsonformatter.curiousconcept.com/