Good morning Community,
I have been working with ArcGIS for a number of year but have only just started to venture into creating my own more complicated content. Specifically survey forms and asset inspection reports.
I am using Field Maps to create a asset inspection reporting system. My result is to change the symbology based on if the asset has been inspected. I have already defined a symbology that needs to be viewed by the field workers.
The solution to this is to create a new field with a concatenated input and define the symbology based on this. I have the following fields;
Solved! Go to Solution.
Hector,
This may be what you are looking for then.
if(IsEmpty($feature.Status)){
return $feature.SCC_ID
}
return $feature.SCC_ID + '-' + $feature.Status
Hector,
Give this a go.
if(IsEmpty($feature.CUT_REGIME)){
return $feature.Parcel_State + ' - Incomplete'
}
return $feature.CUT_REGIME + ' - ' + $feature.Parcel_State
Good afternoon,
Thanks for the quick reply, it is much appreciated. I will try this now.
Do you know if this type of expression can be set to be a recurring calculation based on a set time period. For example every 60 seconds.
Kind regards
Hector,
Attribute rules trigger on insert, update, or delete. So some action would be required to the feature this rule is applied to. There is no way to trigger rules directly by a timer. Batch calculation rules also would not work because batch calculation and validation rules are evaluated at a user-specified time using the Error Inspector or the Evaluate Rules tool. So this would require a person to click and review every 60 seconds.
That being said, I have seen organizations add a field to the feature class and have a script that runs via task manager that updates that field with some arbitrary value. This will trigger attribute rules that do not have any restrictors that prevent an update when edited (e.g. below)
if (($editcontext.editType == "UPDATE" && Equals(Geometry($originalFeature),Geometry($feature)))) {
return ;
}
Additionally, the rule provided to you would trigger if $feature.CUT_REGIME was updated at any time. So if one of the field workers updated that field
~Jake
Hi Jake,
In this particular case, workers would be updating the '$feature.Parcel_State' field with whether it has been completed or not.
Where would I put this expression? My assumption would be to create a 'text - single line' form element, set the field calculated value and then input the expression into that.
Would that be correct?
I have been playing around with changing the symbology of the web map to show if parcels have been completed or not but this doesn't seem to be the most efficient way of doing this.
Hector,
Yes you can apply this to a form element calculation.
Also you can setup rules to fire when another field is updated.
if ($editcontext.editType == "UPDATE" && ($originalFeature.Parcel_State == $feature.Parcel_State)){
return ;
if(IsEmpty($feature.CUT_REGIME)){
return $feature.Parcel_State + ' - Incomplete'
}
return $feature.CUT_REGIME + ' - ' + $feature.Parcel_State
In the rule above if the feature is being updated AND the original Parcel_State is the same as the current value don't do anything. So this means is there is an update to the feature and the Parcel_State has changed run the rule.
~jake
Hi Jake,
If I wanted the field to display the '$feature.CUT_REGIME' alone and then update it with a '- Complete' once the '$feature.Parcel_State' is update by the worker.
This would allow me to set the symbology based off this field alone and it would capture everything I need.
It is displaying an error at the moment.
Thanks so much for the help.
Kind regards,
Hector
Hector,
The error at the moment is caused by the code missing a } after the first return. add a } to line 3.
~Jake
Hector,
I'm a bit confused now to what you are looking to populate in the CUT_REGIME field.
Your original post said you wanted $feature.CUT_REGIME ' - ' $feature.Parcel_State but now you want $feature.CUT_REGIME' alone and then update it with a '- Complete'?
~jake
Hi Jake,
Yes apologies, I see the mistake I made. I was trying to populate the wrong field. Thank you for noticing.
I have amended the expression to: