Select to view content in your preferred language

Value Table Parameter breaks in PYT

242
1
Jump to solution
09-28-2023 08:35 AM
AlfredBaldenweck
MVP Regular Contributor

Hi all, 

I'm having a lot of trouble with my value table parameter. Followed the documentation here. In Pro 2.9.5, but that shouldn't matter for this.

I can get the value lists to show up, but I can't get any values to stick. Neither can I get the default values to work.

Would one of you be able to tell me what is wrong with this?

        param17 = arcpy.Parameter(
                    displayName = "Watermarks (Metadata)",
                    name = "watermarkMD",
                    datatype = "GPValueTable",
                    parameterType = "Optional",
                    direction = "Input")
                    
        param17.columns = [['GPString', 'Dynamic Text'], ['GPString', 'Position']]
        param17.filters[0].type = 'ValueList'
        param17.filters[0].list =["GPSImgDirection","GPSCoordinates",
                                  "DateTime", "File Name", "Name Field", 
                                  "Name Field 2"]
        param17.filters[1].type = 'ValueList'

        param17.filters[1].list =["Upper Left", "Middle Left", "Lower Left",
                          "Upper Center", "Middle Center", 
                          "Lower Center", "Upper Right", 
                          "Middle Right", "Lower Right"]
        param17.values= [['File Name','Upper Right']]

 I can get the two columns to show up, and I can see the values in each list, but selecting them just makes them disappear.

This parameter is not affected by updateMessages(), and only turned off and on by a toggle in updateParameters(). I turned off that toggle functionality just to check and nothing changed.

I have checked, and I don't have two parameters named the same thing, which is normally the issue with this error.

I have also changed up the order of setting the default values/ the value list to match the documentation linked above, and that didn't change anything.

(Changing to all single quotes didn't help either. Ignore my inconsistent use of quotes please)

Basically, I'm out of ideas and am hoping some fresh eyes will catch something I've missed.

0 Kudos
1 Solution

Accepted Solutions
AlfredBaldenweck
MVP Regular Contributor

Oh for Pete's sake.

I did actually have two parameters named the same thing. This is embarrassing.

 

View solution in original post

0 Kudos
1 Reply
AlfredBaldenweck
MVP Regular Contributor

Oh for Pete's sake.

I did actually have two parameters named the same thing. This is embarrassing.

 

0 Kudos