Skip to main content
Skip table of contents

Metadata functions

Overview

The metadata functions are useful for field validation, returning information about the type and structure of fields. The syntax used with a metadata function will vary depending on whether it is used in a tool such as Calculate, or as part of a processing or validation expression in Project parameters.

$exists

Returns a Boolean value, which is True if field_name exists on input record, and False otherwise.

Syntax

  • $exists( "field_name" )

  • $exists( field_name, input_name )

The $exists function has the following arguments:

Part

Description

field_name

Required. Name of field being validated. If used in any project tool or automation step as part of an expression, must be a string enclosed in double-quotes of the form function("field_name").

input_name

Macro input. Used only in project parameters for macro validation.

Remarks

The function $exists tests whether the specified field exists on the input record. The syntax differs depending on where the expression in which it is used is defined:

  • When used in any project tool or automation step that uses an expression, only the parameter "field_name" is supported, and it must be enclosed in quotes as a string. The parameter input_name is not used.

  • When used in the processing or validation expressions of project parameters, both field_name and input_name parameters are supported, and do not need to be enclosed in quotes.

$fieldType

Returns the type of field_name.

Syntax

  • $fieldType( "field_name")

  • $fieldType( field_name, input_name )

The $fieldType function has the following arguments:

Part

Description

field_name

Required. Name of field being validated. If used in any project tool or automation step as part of an expression, must be a string enclosed in double-quotes of the form function("field_name").

input_name

Macro input. Used only in project parameters for macro validation.

Remarks

The function $fieldType returns the type of the specified field as a string value, for example:

CODE
TextVar
TextFixed
Fixed-point
Integer
Floating-point
Date
Time
DateTime
Boolean
Binary
Invalid

The syntax differs depending on where the expression in which it is used is defined:

  • When used in any project tool or automation step that uses an expression, only the parameter "field_name" is supported, and it must be enclosed in quotes as a string. The parameter input_name is not used.

  • When used in the processing or validation expressions of project parameters, both field_name and input_name parameters are supported, and do not need to be enclosed in quotes.

$isNumeric

Returns a Boolean value, which is True if field_name is numeric, and False otherwise.

Syntax

  • $isNumeric( "field_name")

  • $isNumeric( field_name, input_name )

The $isNumeric function has the following arguments:

Part

Description

field_name

Required. Name of field being validated. If used in any project tool or automation step as part of an expression, must be a string enclosed in double-quotes of the form function("field_name").

input_name

Macro input. Used only in project parameters for macro validation.

Remarks

The function $isNumeric tests whether the specified field is numeric. The syntax differs depending on where the expression in which it is used is defined:

  • When used in any project tool or automation step that uses an expression, only the parameter "field_name" is supported, and it must be enclosed in quotes as a string. The parameter input_name is not used.

  • When used in the processing or validation expressions of project parameters, both field_name and input_name parameters are supported, and do not need to be enclosed in quotes.

$isText

Returns a Boolean value, which is True if field_name is Text, and False otherwise.

Syntax

  • $isText( "field_name")

  • $isText( field_name, input_name )

The $isText function has the following arguments:

Part

Description

field_name

Required. Name of field being validated. If used in any project tool or automation step as part of an expression, must be a string enclosed in double-quotes of the form function("field_name").

input_name

Macro input. Used only in project parameters for macro validation.

Remarks

The function $isText tests whether the specified field is of type Text. The syntax differs depending on where the expression in which it is used is defined:

  • When used in any project tool or automation step that uses an expression, only the parameter "field_name" is supported, and it must be enclosed in quotes as a string. The parameter input_name is not used.

  • When used in the processing or validation expressions of project parameters, both field_name and input_name parameters are supported, and do not need to be enclosed in quotes.

$size

Returns the size of the data in field_name as number of characters or bytes.

Syntax

  • $size( "field_name" )

  • $size( field_name, input_name )

The $size function has the following arguments:

Part

Description

field_name

Required. Name of field being validated. If used in any project tool or automation step as part of an expression, must be a string enclosed in double-quotes of the form function("field_name").

input_name

Macro input. Used only in project parameters for macro validation.

Remarks

The function $size returns the size of the data in field_name as number of characters (Text types) or bytes (all other types). The syntax differs depending on where the expression in which it is used is defined:

  • When used in any project tool or automation step that uses an expression, only the parameter "field_name" is supported, and it must be enclosed in quotes as a string. The parameter input_name is not used.

  • When used in the processing or validation expressions of project parameters, both field_name and input_name parameters are supported, and do not need to be enclosed in quotes.

$formatSize

Returns the size of the data in field_name as formatted into text.

Syntax

  • $fieldSize( "field_name" )

  • $fieldSize( field_name, input_name )

The $fieldSize function has the following arguments:

Part

Description

field_name

Required. Name of field being validated. If used in any project tool or automation step as part of an expression, must be a string enclosed in double-quotes of the form function("field_name").

input_name

Macro input. Used only in project parameters for macro validation.

Remarks

The function $fieldSize returns the size of the data in field_name as a text value. The syntax differs depending on where the expression in which it is used is defined:

  • When used in any project tool or automation step that uses an expression, only the parameter "field_name" is supported, and it must be enclosed in quotes as a string. The parameter input_name is not used.

  • When used in the processing or validation expressions of project parameters, both field_name and input_name parameters are supported, and do not need to be enclosed in quotes.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.