@DocLength (Formula Language)

Returns the approximate size of a document in bytes.

Syntax

@DocLength

Return value

length

Number. The size of the document.

Usage

This function works in any formula that runs in the context of one or more documents.

The number returned is only an approximation. The actual size of the document may differ for the following reasons:

  • The number accounts for user data only; it does not take into account per document or per field constants such as static text or formulas.
  • The database allocates storage in 64-byte increments; a document may not use all of the 64 bytes allotted to it.

Documents that are open typically use more storage than documents that are closed. The value returned for @DocLength may vary depending on whether it is running in an open document or a closed document; for example, a document selected at the view level.

Examples

This example returns 1808 if that is the approximate number of bytes in the document (one-page document, no enhanced text).
@DocLength