Show a JSON text in an interface

Hi All,

We have data stored in our DB in text format. But data added can either be text or json. We would need to display the same in the interface in proper format.

That is if data is in plain text we would show it as text and if it is in JSON, we would need to format it and show.

For eg : if data is stored as "XYZ" then we would show either in Rich text editor/text field as XYZ.

If data is stored as text (in actual it is a JSON) - 

{"Field1":"Test","Field2":"value is "not editable" test it.","Field3":"314146282515","Timestamp":"2019-06-19T11:05:23.678+0000","Field4":"XYZ","Reason":"XYZ","Time":"2022-02-19T05:09:26.046+0000","Field5":"ABC","Field6":"yui","Value":"OK","Action":"","Field7":"[abcged]","Field8":"","Field9":{"Value1":"test","Value2":"Test","Value3":"Test","Value4":"Test","Value5":null,"Value6":[{"value":"C:","name":"instance"},{"value":"ty","name":"object"},{"value":"er46","name":"test"}],"Field9":300,"Periods":1,"Operator":"LessThanOrEqualTo","Field10":25.0,"Feild11":"ignore","Field12":""}}

Then it should be shown either in Rich text editor/text field as : 

Field1 : "Test"

Field2 : "value is "not editable" test it." 

so on... in dictionary format.

Please guide how to achieve the above.

  Discussion posts and replies are publicly visible