Autocomplete custom labels for Boolean parameter types

I would like to be able to label the autocomplete options for a boolean parameter, e.g.:

coda.makeParameter({
  type: coda.ParameterType.Boolean,
  name: "isDog",
  description: "Whether the selected animal is a dog.",
  autocomplete: [
    { display: "Dog", value: true },
    { display: "Not a dog", value: false },
  ],
})

Doing so throws a TypeScript error which is likely the expected behaviour since the documentation states this feature only supports strings and numbers (Autocomplete - Coda Pack SDK)

It would be nice to be able to support boolean values as well, although I see how it might be more complex as it would require a fixed size array of options (exactly two).

For the moment a decent workaround is using a Number type and setting the values as 0 or 1 then dealing with the conversion manually.

2 Likes

Hi @loucadufault - Sorry for the slow reply here, somehow I missed this topic when you first posted it. That’s a great suggestions, and you laid out the use case so well! I’ll bring this to the engineering team for consideration.

2 Likes