@IsAvailable (Formula Language)

Checks a document for the existence of a field.

Syntax

@IsAvailable( fieldName )

Parameters

fieldName

Field. The name of a field. Do not treat the name as text. Enter the exact name of the field and do not enclose it in quotes.

Return value

flag

Boolean

  • 1 (True) indicates that the field is contained in the document
  • 0 (False) indicates that the field is not contained in the document

Usage

Use @IsAvailable to provide a default value for documents created with forms that do not include a field name.

This function can be used with select and column formulas using Summary fields only. Non-Summary fields are not available.

For information on creating a field in an existing document if it does not exist, see the FIELD keyword.

Examples

  1. This formula returns the value of the Dept field if it exists in the document, otherwise it returns Consultant.
    @If(@IsAvailable(Dept);Dept;"Consultant") 
  2. This formula returns the value of the field named Topic if it exists in the document, otherwise it returns the value contained in the field named Subject.
    @If(@IsAvailable(Topic);Topic;Subject)
  3. This formula, when added to a hotspot button, checks for the existence of the Priority field in a form, then sets its value if found or creates a new Priority field and sets its value, if not found.
    @If(@IsAvailable(Priority);@SetField("Priority";"High");FIELD Priority := "High")
    Note: If you create the field using this formula, it is not visible on the form, but you can get its value using the @GetField function. Be sure you use the correct spelling and capitalization when checking for the field in the document.