I've added a geoprocessing service to the Geoprocessing widget in Web AppBuilder. Within the GP tool that was authored in ArcGIS Desktop, I have some custom validation logic written using Python, which works fine when running the GP tool in ArcGIS Desktop, but which is ignored when publishing the tool as a GP service and running it via Web AppBuilder's Geoprocessing widget. The UI for my tool consists of 2 drop-down menus to collect the 2 input parameters from the user. The parameter validation needs to happen before tool execution, and I need the validation logic to update the values in the 2nd drop-down menu based on the value that the user chooses in the 1st drop-down menu.
The Geoprocessing widget in Web AppBuilder is a general purpose tool. It doesn't provide such method to set the validation rules for each parameter. Maybe it's a good idea to valid parameter in the client, but all information of Geoprocessing widget in setting page comes from the service definition where there is nothing about the validation rules for input parameters.
I think it's better to develop a custom widget to do the things you want if possible.
It is my understanding based on what I've seen, that only a Python Toolbox published as a GP Service will provide dynamically updating Choice Lists. I don't know why a script tool would not also work. Does Esri have any guidance on this. Does a Python Toolbox run the Custom Validation Code when it gets published as a GP Service?
I am running into the same a problem. Along with this, apparently even multivalue parameter in a script tool doesn't work as expected when published as a gp service.
Any guidance on custom widget would be greatly appreciated!
I have seen this working in a python toolbox. but I have not yet tested myself. I am thinking that the extra python may have more control over the input drop down list. This is just a hunch based on one other GP service I've seen that I believe had an updating pickList. I've not found much documentation on this either.
Thank you for your reply.
I tested the multi-value parameter in python toolbox (.pyt). Apparently both script tool and .pyt toolbox allows multivalue parameter.
But, when we publish these tools to Arc Server (10.6), they allow you to choose multiple inputs based on the data layers which were copied over along with the tool- so the inputs become STATIC. I would like to have the option to upload my own multiple layers while running the tool - more like DYNAMIC inputs.
This behavior could be seen when you publish a basic Merge gp tool as well (this tool which is suppose to accept multiple inputs).
Any update on this? I am trying to publish a gp service to be used in WAB that allows the user to select any layer within the first parameter and have a dropdown in the second parameter of fields associated with that layer.