Constants

The following constants are available for your convenience in writing expressions.


Infinity

Since version 1.0

Function bundle: Core

Represents a value greater than any other number. -Infinity may also be used as a value smaller than any number.

Example

Calculates the maximum of four field values

1
2
3
4
5
6
7
8
var values = [ $feature.field1, $feature.field2, $feature.field3, $feature.field4 ];
var maxValue = -Infinity;

for(var i in values){
  maxValue = IIF(values[i] > maxValue, values[i], maxValue);
}

return maxValue;

PI

Since version 1.0

Function bundle: Core

The value of a circle's circumference divided by its diameter, approximately 3.14159.

Example

Returns the area of a circle feature

1
2
var r = $feature.radius;
PI * r * r;

TextFormatting.BackwardSlash

Since version 1.0

Function bundle: Core

Inserts a backslash character \ into the text.

Example

Returns '\\serverName\foo\bar'

1
TextFormatting.BackwardSlash + TextFormatting.BackwardSlash + $feature.FILE_PATH

TextFormatting.DoubleQuote

Since version 1.0

Function bundle: Core

Inserts a double quote character " into the text.

Example

Returns 'Nicholas "Nick" Anderson'

1
$feature.NAME + " " + TextFormatting.DoubleQuote + $feature.ALIAS + TextFormatting.DoubleQuote + " " + $feature.SURNAME

TextFormatting.ForwardSlash

Since version 1.0

Function bundle: Core

Inserts a forward slash character / into the text.

Example

Returns '151/low'

1
$feature.POP_DENSITY + TextFormatting.ForwardSlash + $feature.CLASS

TextFormatting.NewLine

Since version 1.0

Function bundle: Core

Inserts a new line, or line break, into the text. Multi-line labels are NOT supported in the ArcGIS API 3.x for JavaScript nor in the ArcGIS Online Map Viewer Classic.

Example

Returns "T2N
R1W"

1
"T" + $feature.TOWNSHIP + TextFormatting.NewLine + "R" + $feature.RANGE

TextFormatting.SingleQuote

Since version 1.0

Function bundle: Core

Inserts a single quote character ' into the text.

Example

Returns "Nicholas 'Nick' Anderson"

1
$feature.NAME + " " + TextFormatting.SingleQuote + $feature.ALIAS + TextFormatting.SingleQuote + " " + $feature.SURNAME

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close