1 Reply Latest reply on Aug 9, 2020 10:10 PM by Prathap Reddy

    Can we convert the process object(JSON) object to string?

    Pankaj Chaudhary Active Member

      We have a case in which we have to print the request body(in JSON format) as string in a field in the output. How can we achieve that?

      Example:

      This is the request body:

      {

         "Field1" : "value",

         "Field2" : {

                    "Field3" : "value"

         }

      }

       

      We want the object as a string as we have to use further in an object

      Target Response:

      {

         "Request payload" :"{\"Field1\":\"value\",\"Field2\":{\"Field3\":\"value\"}}",

         "Output" :"value"

      }

       

      As in Java if we want to convert the object to string then there is a method named "to string" which can convert it to the string.