Since version: 1.36
With the Form Attachment Filename Calculation profile, expressions can be written to update a form attachment filename based on expression logic. This profile is used when defining form calculations in Field Maps, allowing authors to override the default attachment filename.
Context
The following products implement this profile:
- ArcGIS Online
- ArcGIS Field Maps
- ArcGIS Maps SDKs for Native Apps
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 Name | Type | Description |
|---|---|---|
| $feature | Feature | Exposes the feature's attributes for use in the calculation. |
| $originalFeature | Feature | The previous state of the feature being calculated. |
| $layer | FeatureSet | A collection of features in the same layer as $feature. |
| $datastore | FeatureSetCollection | A collection of layers in the same feature service or database as $feature. |
| $featureSet | FeatureSet | A collection of features in the same table as $feature. |
| $map | FeatureSetCollection | A collection of feature service layers in the same map as $feature. |
| $formElement | Dictionary | The properties available from the form element, as defined in the table below. |
Properties of $form:
| Variable Name | Type | Description |
|---|---|---|
| attachmentKeyword | Text | The attachment keyword associated with the form element. |
| label | Text | The label of the form element. |
| description | Text | The description of the form element. |
Function bundles
Core | Geometry | Data Access | Database | Portal Access
Return types
Example
Returns the attachment keyword appended with the current date and time.
var keyword = IIf(!IsEmpty($formElement.attachmentKeyword), $formElement.attachmentKeyword, 'none');
var currentDate = Text(Now(),'YMMDDHHMMSS');
var attributes = [keyword, currentDate];
return Concatenate(attributes,"_");