Select to view content in your preferred language

Geoprocessing services do not respect enabled validation

1111
1
05-22-2025 08:10 AM
DougBrowning
MVP Esteemed Contributor

I am seeing that hiding params using self.params[3].enabled = False works great as a regular toolbox but when I publish the tool as a service in both Pro and ExB this does not work and it just always shows the param.

def updateParameters(self):

if(self.params[2].value):
self.params[3].enabled = True
else:
self.params[3].enabled = False
return

Is this a known issue?  I am seeing a number of things that work in a toolbox but not as a service.

Another example is Category is not supported in ExB but does work in Pro.  This is making it hard to create a consistent user experience.

Is there any doc on what is and is not supported when publishing?

thanks

 

 

 

0 Kudos
1 Reply
DavidPike
MVP Notable Contributor

It's been a while since I've needing to publish any GP tasks but I do remember it being very trial-and-error when it comes to validation.  My thinking/wisdom (right or wrong) essentially ended up as:

I'm guessing any validation is really limited and static, probably as it's only enacted when the tool is first opened, rather than dynamically after each argument input. 
If the validation has to actually do/retrieve something from somewhere outside of the validator code - it's not going to work.

0 Kudos