The conditional domain value profile allows the available domain values presented to users to be a subset of the full domain. This is useful when the list of values available is dependent on other field values.

Profile variables

Variable nameTypeDescription
$mapFeatureSetCollectionThe list of layers in the web map. Can be used with the FeatureSetByName or FeatureSetById function to get a particular layer in the map. This can then be queried.
$userIdTextThe unique user ID of the editor who is logged into the application.
$userNameTextThe full name of the editor who is logged into the application.
$userIdentityTextProvides a credential instance. This can be used when accessing external layers with the FeatureLayer function. The credentials represent the user’s logged in credentials.
$sessionDictionaryA dictionary containing key value pairs. The dictionary contains all the session variables that have been configured in the app. When the application first launches, the user will be asked for values for the session variables. They can also (if configured) change session variables in the application. This provides programmatic access to the user’s choices / settings.
$editingLayerFeatureSetThe layer to which $feature belongs to. Can be queried to find other records.
$featureFeatureThe feature that has been edited, added or worked on.
$valueAnyThe value to test in the script. Certain rules, such as the restrict domain values rule, pass in a value for the current field value.
$parentFeatureFeatureIf there is a geographic contains relationship for the current feature being edited, this variable will contain the parent (or containing feature).
$routeFeatureFeatureIf the feature is a linear referencing feature, this variable will reference source route/line feature.

Return types

Array | null

ValueDescription
[‘code1’, ‘code2’, …]Array of allowed domain codes.
nullUse all codes.

Example

Change domain based on a dependent field:

/** Change the available choices from a domain list based on the value
 *  of another field value.
 *
 * In this example if the field TestField is ORA, then restrict the domain 
 * to 3 choices. Otherwise return null (which means the full choice list 
 * available on the original domain). 
 * 
 * Arcade has in-built helper functions for working with domains:
 * - Domain, DomainName, DomainCode
 *
 * @returns - The Arcade Script expects an array[] of choices to be returned.
 *
 */

if($feature.TestField == "ORA"){
    return ["EU", "EX", "EN"]
} else {
    return null //  return full domain choice list
}