@DocDescendants (Formula Language)

In a column or window title formula, returns the number of descendant documents or subcategories belonging to the current document or category. Where @DocChildren only counts direct descendants, @DocDescendants counts all descendants, regardless of level.

Syntax

@DocDescendants @DocDescendants( defaultString ) @DocDescendants( zero-string ; defaultString ) @DocDescendants( zero-string ; one-string ; defaultString )

Parameters

defaultString

Text. Optional. The text to return. If a "%" is used in the string, it will be replaced with the number of descendant documents or categories. Example: "% Responses."

zero-string

Text. Optional. The text to return if the document or category has no descendants, such as "No Responses."

one-string

Text. Optional. The text to return if the document or category has just one descendant, such as "One Response."

Return value

The return value can be either special text or text:

numChildren

Special text. If @DocDescendants is called with no parameters, then the number of descendant documents belonging to the current document or category is returned. You cannot convert special text to a number.

childString

Special text. If @DocChildren is called with one or more parameters, it returns the appropriate string, based on the number of descendant documents belonging to the current document or category. You cannot convert special text to a number.

Usage

Use @DocDescendants in window title and column formulas, when you want to indicate the total number of responses (at all levels) to a particular document, or the total number of documents within a particular category. This function does not work in any other formula.

This @function is calculated when the document is opened. Results are undefined in cases where the document is not opened, such as printing from a view.

You cannot use this function in Web applications, except in column formulas.

Examples

  1. This example returns 3.
    @DocDescendants
  2. This example returns 3 Response(s).
    @DocDescendants("% Response(s)")
  3. This example returns 3 Responses. If there are no responses to the document, the formula returns No Responses.
    @DocDescendants("No Responses";"% Responses")
  4. This example returns There are 3 Responses. If the document has one response, the message is 1 Response; if the document has no responses, the message is No Responses.
    @DocDescendants("No Responses";"1 Response";
    "There are % Responses.")