AnsweredAssumed Answered

Python - Select Multiple Checkbox Choices to Calculate a Field

Question asked by sarahjwillett on Jun 15, 2016
Latest reply on Nov 2, 2016 by sarahjwillett

Hello all,

I want to allow the user who runs the script to select however many choices from a list to populate a field.

 

The choices are all string values I created in the script tool parameters using the Value List Filter for the Expression parameter.

 

For example:

    After using Add Field function, I need to populate/calculate the "Choices" attribute column.

     *The Choices field is not present before running the script. This is just to help visualize what I need.

     screen_capture_4_shapefile_attribute_window.png

The script window.

screen_capture_1_script_window.png

 

The following is the code for this script.

*This was extracted from Model Builder.

screen_capture_2_script_code.png

 

The following is the validation code for the script (which is the standard for a new script).

     screen_capture_3_script_validation.png

The following shows the parameters for the script.

     screen_capture_6_script_parameters.png

The following is the error message I get when running the script.

     screen_capture_5_error_message.png

I am new to Python and could use some guidance.

Thanks,

Sarah

Outcomes