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:

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.
$originalFeatureFeatureThe previous state of the feature being calculated.
$layerFeatureSetA collection of features in the same layer as $feature.
$datastoreFeatureSetCollectionA collection of layers in the same feature service or database as $feature.
$featureSetFeatureSetA collection of features in the same table as $feature.
$mapFeatureSetCollectionA collection of feature service layers in the same map as $feature.
$formElementDictionaryThe properties available from the form element, as defined in the table below.

Properties of $formElement:

Variable NameTypeDescription
attachmentKeywordTextThe attachment keyword associated with the form element.
labelTextThe label of the form element.
descriptionTextThe description of the form element.

Function bundles

Core | Geometry | Data Access | Database | Portal Access

Return types

Text

Example

Returns the attachment keyword appended with the current date and time.

Use dark colors for code blocksCopy
1
2
3
4
5
var keyword = IIf(!IsEmpty($formElement.attachmentKeyword), $formElement.attachmentKeyword, 'none');
var currentDate = Text(Now(),'YMMDDHHMMSS');
var attributes = [keyword, currentDate];

return Concatenate(attributes,"_");

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