getAllTags(path, [options]) Last updated: 11. Aug 2026

Returns every distinct tag in use in a folder — the list you need to fill a tag picker, an autocomplete or a filter menu.

Planned. Not yet available in the runtime; this page specifies the intended behaviour.

The values it returns are exactly the values the tag filter on listFiles and getFiles matches, because both are the normalized stored form of the tag. That is what makes the pair useful together: this function tells you what is worth filtering on, the filter then narrows to it.

See also: getTags addTag listFiles Tags are stored as search words

Parameters

Name Type Description
path string

Folder path, from the site root. Pass "/" for the whole workspace. The leading slash is optional.

options (optional)objectSpecify any of the following options parameters:
recursive bool

Include documents in every subfolder. Default false, which considers only the documents directly in the folder.

Returns

An array of distinct tag words, lower case and sorted alphabetically. An empty array when nothing in the folder is tagged — never null.

The sorting is done for you on purpose. The list is normally rendered straight into a dropdown, and docly.sort() returns null for a plain array of strings, so a caller has no convenient way to order it afterwards.

A folder that does not exist yields an empty array, not an error — the same convention as listFiles and getFiles. A mistyped path is therefore indistinguishable from an untagged folder, so check the path first when a picker comes up empty.

Throws an error if the path is empty or contains .. or a backslash.

Like getTags, this function is not restricted to the API folder — the same tags are already readable through listFiles(tags: true).

Example

Code example (#JS)

#JS is mixed HTML (or other text file) with inline JavaScript with # starting and ending each inline statement.
#{
    /* Every tag used anywhere in the workspace */
    let tags = docly.getAllTags("/", { recursive: true });

    write("<select name=\"tag\">");
    for (let tag of tags)
    {
        write("<option>" + tag + "</option>");
    }
    write("</select>");
}#

Output

The #JS code above produces the output shown below:
<select name="tag"><option>2024</option><option>annual</option><option>archived</option><option>faktura</option><option>invoice</option><option>paid</option></select>