I'm looking at automating my workflow, the last step of which includes using an arcade expression to calculate a field. Basically Python's doing all the heavy lifting beforehand, and Arcade is being used to make the end result pretty.
Is it possible to automate an arcade expression like you would a python script?
If not, is there an easy way to run it, wrapped in a python script, from within the Model Builder?
Or do I have to rewrite it in Python?
Thanks!
Solved! Go to Solution.
Is it possible to automate an arcade expression like you would a python script?
Depends. You can't execute an Arcade expression in certain intervals like you could with a Python script. But you can write Attribute Rules that automatically calculate your field.
If not, is there an easy way to run it, wrapped in a python script, from within the Model Builder?
You can use your Arcade expression in the Calculate Field tool.
Arcade is being used to make the end result pretty
If all you want to do with Arcade is to prettify things, you could also do that in the Popup.
Is it possible to automate an arcade expression like you would a python script?
Depends. You can't execute an Arcade expression in certain intervals like you could with a Python script. But you can write Attribute Rules that automatically calculate your field.
If not, is there an easy way to run it, wrapped in a python script, from within the Model Builder?
You can use your Arcade expression in the Calculate Field tool.
Arcade is being used to make the end result pretty
If all you want to do with Arcade is to prettify things, you could also do that in the Popup.
I'm actually using it to calculate the field because using the same expression in hosted layer's popu makes the pop-up take 30 seconds-1 minute to load per feature, vs 30 seconds to calculate the field across the entire dataset all at once and have the information there permanently until the next update.
It looks like Calculate Field is going to be the perfect tool for this. I didn't realize it was able to be used in Model Builder.
Thanks!
is it possible to store an Arcade expression in memory rather than having it write to an attribute table? I'm hoping to create a model that selects features that are marked as Complete and if they are older than 30 days (this would be my arcade expression - something like CompletedDate < DateAdd(Date(),-30,'days')) delete the points.
While you can delete features with Arcade, doing so in the Field Calculator is complicated.
If you want to build a model, you can do this easily with the available ArcGIS Tools:
In the Select Layer By Attribute tool, use this SQL expression (this works for a file gdb, you might need a different expression if you work in an enterprise gdb):
TextField = 'Completed' AND DateField < CURRENT_DATE() - 30