3

I am getting stuck when I want to create a new python script in toolbox. The function I want to develop is to let user to input the user ID, then retrieve from the database the other values to allow user to do the updating.

In this case, I want add a "Retrieve" button in the script to allow user to get their details.

enter image description here

Is it possible?

1 Answer 1

3

This is absolutely possible however you will not be able to add new elements into a GP tool window GUI. Regardless whether you are using Python toolbox or a custom script tool, you will need to look into two concepts:

updateParameters and parameterDependencies (Python toolbox)

Obtained from property of parameters and ToolValidator class (script tool)

For instance, you will be able to get list of fields from a feature class your user will specify. If the standard behaviour of obtaining information of the objects users supply is not enough, consider using ToolValidator class or implementing this logic directly in the Python toolbox.

I would go for a Python toolbox in your case since you will have more options (and imho it is easier to write and maintain the code) in reading the data back based on the input.

Good readings on the question: Are there any distinct advantages of creating a Python Toolbox over a Custom Toolbox?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.