Documentation Home Scripting Reference JSON For Scripts Convert A JSON Value To A String (serialization) Convert A JSON Value To A String (serialization) Any TJSONValue can be converted (serialized) as a string value using ToJSON method:JsonString := Object.ToJSON; var obj: TJSONObject; begin obj := TJSONObject.Create; obj['subobject'] := TJSONObject.Create as TJSONValue; obj['subobject']['key1'] := TJSONString.Create('value1') as TJSONValue; obj['subobject']['key2'] := TJSONNumber.Create(123.45) as TJSONValue; obj['foo'] := TJSONString.Create('bar') as TJSONValue; LogInfo(obj.ToJSON); obj.Free; end; Output{"subobject":{"key1":"value1","key2":123.45},"foo":"bar"} Modifying Child Elements Of JSON Objects And Arrays Objects References And Deep Copying