Geoprocessing service that uses Field Calculator

930
5
Jump to solution
09-14-2016 09:59 AM
StephenSchmidt2
New Contributor II

Hello!!  I'm looking to create a Geoprocessing Service that uses the field calculator tool to concatenate fields.  The original feature service is the output.

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

I see you have ArcGIS Server installed on your local machine. You could also consider using a scheduled task with a python script that will update the field at a predefined moment. If the FieldCalculator does not work for using a different input and output variable, you could consider writing a simple script that will update the field. I would prefer using the UpdateCursor—Help | ArcGIS for Desktop over using the FieldCalculator. Important to configure your service in such a way that it does not lock the schema (see Disabling schema locking on a map service—Documentation (10.4) | ArcGIS for Server )

View solution in original post

5 Replies
XanderBakker
Esri Esteemed Contributor

So you intent with this GP service to update the schema of the service, adding a new field? Why do you want to do this with a GP service (and how often are you planning to run the GP service, just a single time)?

0 Kudos
StephenSchmidt2
New Contributor II

 Xander!  Thanks for the reply!  The Feature Service actually already has the field that I'd like to populate with the concatenation of three other fields.  What we're doing is building a URL in that field from a point ID (one field), and two auto populated URL pieces (fields two and three).  The final product is a functional URL. The point ID is specified by a user with the editor widget when they add a location to the map.  When the new location is created, the two parts to the URL are auto populated in their fields.  The next final step would be to run the geoprocessing widget to populate the final field with the combined three pieces.  When I run the model that I'm publishing as a Geoprocessing Service locally, it works great at generating the correct URL.  What's confusing me is that in the Geoprocessing Widget, the input and the output are the same feature service.  When I publish the model as a GP, it runs in the Geoprocessing Widget, but does not concatenate.  Below is a screen grab of the field calculator.  Thanks!!!

0 Kudos
XanderBakker
Esri Esteemed Contributor

I see you have ArcGIS Server installed on your local machine. You could also consider using a scheduled task with a python script that will update the field at a predefined moment. If the FieldCalculator does not work for using a different input and output variable, you could consider writing a simple script that will update the field. I would prefer using the UpdateCursor—Help | ArcGIS for Desktop over using the FieldCalculator. Important to configure your service in such a way that it does not lock the schema (see Disabling schema locking on a map service—Documentation (10.4) | ArcGIS for Server )

View solution in original post

StephenSchmidt2
New Contributor II

Hi Xander!  The scheduled task with a python script is working like I hoped!  Thank you for the suggestion!

0 Kudos
XanderBakker
Esri Esteemed Contributor

Great to hear that. Congratulations!

0 Kudos