On this page
The messages profile defines what message to show to the end user. It is triggered by changes to dependent layers which are being watched, or by other application changes.
Profile variables
Variable name | Type | Description |
---|---|---|
$map | FeatureSetCollection | The 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. |
$userId | Text | The unique user ID of the editor who is logged into the application. |
$userName | Text | The full name of the editor who is logged into the application. |
$userIdentity | Text | Provides a credential instance. This can be used when accessing external layers with the FeatureLayer function. The credentials represent the user’s logged in credentials. |
$session | Dictionary | A 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. |
$selection | FeatureSetCollection | The list of layers in the web map. Can be used with the FeatureSetByName or FeatureSetById function to get a particular layer in the map. It will only contain the features from each layer selected on the map. This can then be queried. |
$currentMapExtent | Extent | The current map extent. This value is not available for all scripts. |
$currentTool | Text | The type of tool selected. Will be one of new , add , effects , reshape , subtract , pan , select , unprotect . This value is not available for all scripts. It also represents the current state, not the state for why the script is running. |
$drawingShape | Polygon | The current drawing shape being digitised on the map. Not available for all scripts. |
$drawingShapeLastPoint | Point | The last vertex added to the drawing Shape being digitised on the map. Not available for all scripts. |
$typeofEditOperation 1 | Text | The type of operation that just caused the feedback script to run. Will be one of new , add , newrelated , attributes , delete , effects , merge , split , reshape or subtract |
$unchangedMap 1 | FeatureSetCollection | The list of layers in the web map with data as it was originally before the current editing operation began executing. This is not available for all situations where scripting is run. |
$editedFeatures 1 | FeatureSet | The set of features that have just been edited. This works with the FeatureSetByName or FeatureSetById function, to get access to a per layer set of features. This will not contain deleted features, as they are no longer in the map. |
$originalEditedFeatures 1 | FeatureSet | The set of features that have just been edited (in their original form). This works with the FeatureSetByName or FeatureSetById function, to get access to a per layer set of features. This will contain deleted features. |
1: Will only be available if this is a post edit message
Return types
null | Text
Value | Description |
---|---|
null | No message to show |
‘message’ | Text to show in the message. |
Example
Show message when records with a certain status are edited:
/** Provide a message post edit if a certain field value is present.
*/
// get the edited features in the map layer.
var editedFeatsFeatSet = FeatureSetByName($editedFeatures, "Building Site");
// filter for any which matched a certain criteria.
var records = filter(editedFeatsFeatSet, "STATUS=1");
// If there are edited features found with the above condition show a message.
if (count(records) > 0) {
// Show the following message
return "You must seal the record now you have closed it";
} else {
// Do not show a message
return null;
}