Publish geoprocessing service with generic featureset schema?

663
5
11-11-2022 02:45 PM
FredSpataro
Occasional Contributor III

Hi All, 

I have a geoprocessing tool that will work on any featureset I provide it in the tool window.  But when I publish the tool as service, the schema gets locked to the exact match of the features I used to run the tool for publishing.  Then it's not at all generic for the needs of the service.  

Is there an 'empty schema' that can be used to run the tool for publishing or a way to tell the publisher to ignore the schema?

Thanks 

Fred

0 Kudos
5 Replies
FredSpataro
Occasional Contributor III

Bit of follow up... 

Wasn't able to find a way to make the service publish without a default schema using a single value input parameter.  If you use a multi-value input parameter it appears to be less defined. 

However, the key to using the service either way is to make sure to include the 'fields' object on the FeatureSet json.   When the fields object is included, your schema follows thru as you'd expect.  If the fields object is NOT included in the json, then the 'default' schema is used --- which was what caused my original issue. 

DEWright_CA
Occasional Contributor III

Did you realize that you can go to the AGS site folder where the geoprocessing script is published and update the script post publish?

I have several where the publishing process replaces variables to make them hardcoded; that I then went into and replaced them to make them actual variables and that worked great.

Take a look at the published script as a starting point.

0 Kudos
FredSpataro
Occasional Contributor III

Thanks DEWright_CA.  Yes been there done that, this appears to be more in the compiled tbx that's produced for the service rather than the python I can manipulate.  The data/schema is already modify by the time the script receives it. 

0 Kudos
FredSpataro
Occasional Contributor III

Hi zain909, 

see my notes above.  the default schema will ONLY be used if the incoming json doesn't have a 'fields' property.  if the json has a fields, the service will correctly use them.  

 

0 Kudos
DamianoMontrasio
New Contributor III

Hi @FredSpataro  I've similar issue described here https://community.esri.com/t5/arcgis-pro-questions/publish-arcmap-geoprocessing-service-with-arcgis/... but is not clear for me where i must use or not 'fields' property.

Your suggestione is really appreciate.

Thanks.

Damiano

0 Kudos