In ArcPro 2.9.5 I have a python script tool in the new toolbox (.atbx) with validation that sets the filter.list.
The issue I am seeing is that the values in the list are all empty strings. The number of rows is correct but the values are all empty.
I've simplified my python code to just set ['test1', 'test'2'] as the filter.list and it shows up like the screenshot below. What could I possibly do differently here to make this work? I am going to try the old style toolbox.
Well i copied the script tool into the legacy (.tbx) toolbox and it worked as expected. It seems like this is probably a bug in the new (.atbx) toolbox. I hope this might help.
Thanks!
Keep it simple.
Basically, what I think is happening is you're applying the list to a copy of the parameter filter, not the actual filter? (Or maybe not, but that's how it makes sense to me in my head lol) Either way, this works.
def initializeParameters(self):
filterlist = ["test1", "test2"]
self.params[0].filter.list = filterlist
return
Well my script tool is not really that simple which could be partly to blame for the apparent bug. When I copied it into the legacy toolbox is just worked. I did previously try setting the filter.list using the same syntax on a single line previously and it didn't work. My best guess is that something in the script tool itself was causing an issue. Maybe something with the other parameters. Since I've already deleted the .atbx file I cannot copy the script tool from a legacy into a new .atbx to test again. It would take me too much time to rebuild so I am just going to finish it in the legacy toolbox, then if I have time I will take another look. Thanks for the feedback. When I get some time to rebuild in the .atbx I will give it another try.
You can copy a script tool from a tbx to an atbx by right-clicking; all you need is an atbx to paste it into.
Definitely when you have time to try again, share more of your parameters/validation and we can figure out what the problem is.
I am getting an error when I try to paste the script tool into a new .atbx toolbox from a legacy but it worked the other direction for me. I've tried creating an .atbx in a different folder too. I just assumed they were not compatible, but this could just be an issue with the Citrix environment or the File System. It's been a headache working in this environment for sure.