in Field Maps Arcade Expression, how can I differentiate between "selecting an existing point" and "adding a new point" within an Arcade expression.
I'm trying to apply a different code based on the action selected by a user (SELECT vs ADD) from a same layer.
currently, i have setup 2 layers in field maps for "Updating" and "adding a new point", but would like to combine them and make it more convenient for user.
thanks,
Wilson
Solved! Go to Solution.
Hello,
I believe what you are looking for is the edit context/edit type. It is a profile variable found in the Form Calculation and Form Constraint Arcade Profiles
https://developers.arcgis.com/arcade/profiles/form-calculation/
https://developers.arcgis.com/arcade/profiles/form-constraint/
Your Add is INSERT and your select is UPDATE.
// Example usage of $editcontext.editType
if ($editcontext.editType == 'UPDATE') {
if (!IsEmpty($originalFeature)) {
var oSelf = $originalFeature.rsrc_previous_feature_info;
var oServiceNumber = $originalFeature.service_number;
if (oServiceNumber == serviceNumber) {return oSelf};
};
};
Hello,
I believe what you are looking for is the edit context/edit type. It is a profile variable found in the Form Calculation and Form Constraint Arcade Profiles
https://developers.arcgis.com/arcade/profiles/form-calculation/
https://developers.arcgis.com/arcade/profiles/form-constraint/
Your Add is INSERT and your select is UPDATE.
// Example usage of $editcontext.editType
if ($editcontext.editType == 'UPDATE') {
if (!IsEmpty($originalFeature)) {
var oSelf = $originalFeature.rsrc_previous_feature_info;
var oServiceNumber = $originalFeature.service_number;
if (oServiceNumber == serviceNumber) {return oSelf};
};
};
Thanks Justin!!! let me try to update my codes🙏
THANKS again! it works!!