QuickCapture

Since version: 1.20

Arcade expressions can be written to calculate fields in records captured with ArcGIS QuickCapture. When the user taps a button in the project, a feature is captured and the app subsequently uses the Arcade expression to populate the value of one of the fields. Then the feature is sent to the underlying ArcGIS service. It is best practice to handle casting within the script for full control of casting behavior to Number, Date, or Text return types.

Context

The following products implement this profile:

Spatial reference

The spatial reference of the map in which the expression executes determines the execution context's spatial reference.

Time zone

The time zone of the map in which the expression executes determines the execution context's default time zone.

Profile variables

Variable NameTypeDescription
$featureFeatureExposes the feature's attributes for use in the calculation.
$layerFeatureSetA collection of features in the same layer as $feature.
$datastoreFeatureSetCollectionA collection of layers in the same feature service or database as $feature.
$mapFeatureSetCollectionA collection of feature service layers in the map used by the QuickCapture project. This variable may be null.

Function bundles

Core | Geometry | Data Access

Return types

Date | Number | Text

Example

Save an attribute from an underlying polygon

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Create a feature set using the 'Regions' layer in the map
var regions = FeatureSetByName($map, 'Regions', ['name']);

// Intersect the current location with the regions and
// get the first region
var region = First(Intersects($feature, regions));

// If the current location does intersect a feature,
// return the name of the region. Otherwise, return null
if (HasValue(region, "name")) {
  return region['name'];
} else {
  return null;
}

Calculate a value from other fields

Use dark colors for code blocksCopy
1
2
3
if( !IsEmpty($feature.InspectorFirst) && !IsEmpty($feature.InspectorLast) ){
  return $feature.InspectorFirst + " " + $feature.InspectorLast;
}

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