Function API only Updated 17 Oct 2026
folderExists(path)
Checks whether a folder exists in the site, including folders the site inherits from the app (publish template) it runs from.
Only available in API scripts. In a page or template, use docly.getFolder(path) != null instead.
Parameters
pathstringrequiredPath to check if a folder exists for.
Returns
true if the folder exists, otherwise false (also for an empty path).
Example
Normal JavaScript, running in the browser or on the Docly™ server.
// Check if there is a folder with name "folder1" that has a sub folder called "subfolder1"
if (docly.folderExists("folder1/subfolder1"))
write("Folder exists!");