Geoprocessing service output files - can they be conditional?

05-21-2020 12:01 PM
Occasional Contributor III

Have a python geoprocessing script, published as a service, that allows users to enter Parcel numbers and then generates a series of pdf maps needed for notifying nearby parcel owners, as well as mailing labels in either pdf or csv format - that is a drop down input parameter that the user selects.

The tool is hooked up to a GP Widget in AGOL.  User can select a few options, then the output files show as links.  All is good, but if the user selects 'pdf' output type for the mailing labels, there is still a link generated for CSV maling label output -it's just a bad link, gives a 404, so it's quite sloppy and misleading just by it's presence. 

I had configured validation code in the tool within ArcMap to handle this, and it worked as desired in that environment, but from what I have seen validation code is not applied to the tool when published as a service.

Is there a way around this - to have the output parameters (files) be present or not based on input values?  All I can think of is making the 'SetParameterAsText' output parameters be nested in 'If elif else' loops, but I'm skeptical that will work.  

Thanks - 


0 Kudos
1 Reply
Occasional Contributor II

Could you share your parameters?

0 Kudos