I am updating a python tool from Desktop (python 2) to Pro (python 3). In my old tool, I scripted the validator class to make updates to some parameters based on user drive changes and choices.
One of the parameters is:
The list is driven from a spreadsheet in the validator class when the tool initializes:
valueList = ~iterate over the spreadsheet and compile a list~
self.params[4].filter.list = valueList
self.params[4].values = self.params[4].filter.list
The parameter in the old tool looks like this:
Where the user can toggle on or off, which items from the list they want by either selecting or deselecting the check boxes or utilize the 'Select All/Unselect All' buttons.
When the tool runs, it will process on the users choices in the list that are checked off and ignore anything that was not.
In ArcGIS Pro, the parameter behaves a little differently. First, the appearance has changed:
In the above image, the list is populated based on the same validator logic above, but does not have the check marks beside it (let's call this the main list). In order for the user to get the option to check off items from the list, they have to click on the dropdown button (highlighted yellow in the image above) which will pop out a submenu with the same list (lets call this the sub list) except here, the user can then check off the items they want.
Issues with this:
It seems there is a disconnect I am missing between how these 2 lists communicate with each other in Pro.
I've tried to test when the list is altered using the 'updateParameters' function in the validator, but it doesn't seem to pick up that the list has been altered by the users choices.
Solution:
Ideally, I want what I had in my Desktop tool. Basically, a pre-populated list that allows the user to choice which items that want and have the tool accept those choices and to maintain the sorting of the list I set in the validator.
Deleted original reply. Desired behaviour can be achieved with a python toolbox (.pyt) instead of a script tool in a custom toolbox (.tbx).
Thanks Luke. That solved the issue! These subtle changes keep throwing me for a loop but at least I am slowly getting my tool into Pro. Cheers.