Calculation script

365
2
04-21-2020 03:20 PM
ErikLeigh
New Contributor III

Python newb here.  I know just enough to make trouble for everyone else.  Does anyone have a python script that I can steal that will cycle through all available records of an online feature service and concatenate three or four fields into one string field each time the script runs?  I'm trying to update a field and don't want to run a calculation multiple times a day.  Thanks for code or ideas! 

PS. I'm already using the DetectEdits script.  If you are familiar and think it would be possible to add code to this script then maybe that would be more efficient.

Ismael Chivite

Jake Skinner

0 Kudos
2 Replies
JakeSkinner
Esri Esteemed Contributor

Hi Erik,

If you're trying to update a field in a feature class from a feature service, I would recommend using ArcGIS Pro.  You can execute the Join Fields tool to join the fields to the feature class.  Then, run the Calculate Field tool to concatenate the fields.  Finally, you can delete the joined fields by executing Delete Fields.

0 Kudos
ErikLeigh
New Contributor III

Hello Jake, 

Thanks for the advice.  I'm definitely investigating ArcPro, however, I don't have it at the moment and my computer doesn't pass the scan for minimum system requirements. So that may take some work.  Myself and a number of colleagues are scheduled to take the migration class next month.  Maybe that will help.

I'm collecting public reports using survey123 and trying to integrate those into a shortlist story map.  One of the problems I'm trying to solve is that the shortlist templates only take 5 description fields.  The information I want to display is more like 8 individual lines.  So I've tried to concatenate fields to one or two description fields with line breaks or carriage returns.  So far I have not been able to get any of that to work.  Survey123 seems to have the ability to create a auto-calculate field in the xls form, but it doesn't seem to recognize anything I do to create a new line.  ArcOnline has a calculation field and seems to concatenate fine, but that must be run manually each time I want to update and I would like it to update at least once per day, if not more often. I'm trying to make all of this hands off as much as possible. Hopefully that helps narrow down the issues a bit?  I've seen that other people seem to be able to accomplish this so I'm not sure if I'm missing something easy or if there is some technique I'm not aware of or maybe they are just spending a lot more man hours updating fields.

0 Kudos