Select to view content in your preferred language

ArcPro Multivalue parameter keeps sorting in python script tool, is this a bug?

635
2
01-28-2023 03:02 PM
DuncanHornby
MVP Notable Contributor

I am developing a suite of geoprocessing tools in Python in the new ArcPro 3.0.1 toolbox (atbx).  One of my parameters is a multivalue parameter of fields which is dependent upon a previous parameter selection (the layer the fields are coming from).

DuncanHornby_0-1674946265004.png

This creates the desired ability to choose one or more fields from the layer. But during testing I have noticed an odd behaviour which I don't want and am unsure if this a property that can be fixed through coding or its a bug, or (unwanted) behaviour baked in by esri?

So.. If I run the tool, set the layer, I can choose my fields; if I select them via the drop down then they are displayed in order as they are in the attribute table as shown below:

DuncanHornby_1-1674946571508.png

The fields are displaying in the order as they are found in the attribute table (i.e. unsorted)

 

But if I use the add many fields button the list is displayed in name sort order as shown below:

DuncanHornby_2-1674946702180.png

Fields in drop down are presented in name sort order

How do I stop/correct it from sorting by name order?

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

hmmm

multivalue.png3.1


... sort of retired...
DuncanHornby
MVP Notable Contributor

So this is functionality that's coming in 3.1? So sit and wait is your advice! Will be interesting to see if that cog button is something exposed to the developer when creating a script tool?

0 Kudos