I have a point layer "sites" and a related table "inspections" running for Field Maps data collection and a Dashboard visualization of what's going on (based on this workflow). In the webmap popup I can use Arcade to find the most recent inspection (or no inspection) in the related table based on each site point, etc. Now I need to populate fields in the parent point "sites" layer with a daily update for "next inspection" (a straightforward calculation based on data in "sites" attribute table), "last inspection" (a query of the related records for each site), and a third field where an arcade script decides if an inspection is due. I can calculate these manually in the Data view at ArcGIS.com with arcade. Is there a way to automate this to run daily via ArcGIS.com or ArcPro desktop? I can't figure out how to reference, sort, select most recent inspection, etc from the related table data in model builder for Pro desktop (to schedule a task) or how to use Calculate/Notebooks with Arcade to schedule a task online.
I just figured out a workflow for this recently that's been running pretty well for the past couple months now, but unfortunately there is not a way to schedule run an Arcade script (I much prefer Arcade as well, and looked for an Arcade solution for a while before giving up) so this is a job for Python. For the "bones", I referenced this blog post which got me really close to a working script. I tweaked it with some trial and error and tried to document that in this comment on the blog.
This may give you a starting point, but you will likely have some more customized code for your specific calculations.
You can run this as a scheduled ArcGIS Notebooks task in ArcGIS Online. Better than ArcGIS Pro as it's always on.
I would recommend:
You will need to use Python but it's similar enough to Arcade and the above workflow is relatively lightweight. Make sure to test your python script on test data and use try/except + print() to help with errors and troubleshooting.
https://doc.arcgis.com/en/arcgis-online/create-maps/prepare-a-notebook-for-automated-execution.htm