SaveJson(filePath, data) Last updated: 17. Aug 2023

API only function

Saves a JSON file to Docly with specified data stringified to JSON. See also "SaveFile" - it is a more advanced function to save Docly documents with any specified schema.

Parameters

Name Type Description
filePath string Absolute path to where you want to save data.
data object Data to store, will be converted to JSON server side.
If data specified is a string, it will be saved directly as text.

Returns

A reference to the saved file with a timestamp and guid for the file.

Example

Code example (JS)

JS is normal JavaScript either running in the browser or on the Docly™ server.
// This will save a file to Docly in JSON format
let data = { "Property" : "Test value" };
docly.saveJson("Test files/Test.json", data);