getJson(filepath) Last updated: 17. Oct 2026
Loads a document and returns its stored values as an object. Works on any document — a .json code file, or a schema document (you get its fields).
See also: getFile saveJson Path traversal
Parameters
| Name | Type | Description |
|---|---|---|
| filepath | string | Path of JSON (code file) to load as object. |
Returns
The parsed object. null when the file does not exist. Throws if the path is empty. A document in an encrypted folder is decrypted, which requires unlockFolder first.
Example
Code example (JS)
JS is normal JavaScript either running in the browser or on the Docly™ server.let data = docly.getJson("Test files/Test.json");
data.Added = "I added this property";
return JSON.stringify(data); Output
The JS code above produces the output shown below:{"Content":"{\n \"Description\" : \"This is a test file\"\n}","Added":"I added this property"}