How to write a json object in a file

Hey guys! I’m a newbie in Camunda Modeler and I want to save a JSON object in a file with specific path. I have no idea how to write the script to log the JSON object. Do you have any suggestions?

What kind of JSON object do you want to save?

Any kind of it could be. You assume its got one string key and one string value.
I want to log some elements as Json Objects. These elements are mostly http response from rest methods.

Please tell more about your use case and what you have tried out already.

Yes sure, but there isn’t much to say. I have a service task. Its implementation is http-connector and I define a url ,get method, headers as input parameters and response and statusCode as output parameters. I fetch some data from this service task and I want to log response data into a file. I spin the response result and fetch elements from it before saving them. Now my question is how I can save the elements which are Json objects into a file.
One example of the elements is as below:
{
“name”:“Silver”,
“family”:“Hedayati”
}

Ok, so if I get it correctly, you want to log the response. Perhaps the logging section of the docs could be useful: Logging | docs.camunda.org

Yes,exactly. Thanks for the hint, I’ll read it and get back to you if I have any questions.