DataConnectors icon indicating copy to clipboard operation
DataConnectors copied to clipboard

Avoid null option in for connection dialog dropdown

Open bdeboe opened this issue 4 years ago • 2 comments

I want to add a simple yes/no option to my connection dialog. I can use Documentation.AllowedValues to limit the available options to yes and no, but have trouble getting rid of the blank option in the dropdown while still preserving the default value.

I'm declaring the parameter like this:

        hideSystemTables as (type text meta [
            Documentation.FieldCaption = "Hide system tables",
            Documentation.FieldDescription = "If set to Yes, system tables will be hidden",
            Documentation.AllowedValues = { "Yes", "No" },
            Documentation.DefaultValue = { "Yes" }
        ])

and get the dropdown with a blank option, ignoring my default value on the most recent version of Power BI.

Surprisingly, until I upgraded to this version, I could get either the default values or a dropdown without the blank option:

  • when adding the optional keyword to the field declaration, I would get the default value pre-populated, but users could still select a blank row in the dropdown
  • when leaving the optional keyword out, I would not see the default value pre-populated, but at least didn't see the blank row.

So from an either/or situation, I'm now in a no/no case after the upgrade :-p

Anything trivial I'm missing or a Documentation. modifier I overlooked when scouring the docs?

bdeboe avatar Jan 24 '20 09:01 bdeboe