[Bug-13964]Simple SQL query to perspective Dropdown options

I cannot seem to bind a SQL Query into the Perspective Dropdown, Props, Options.
My error is “Objects Found, Array Expected.”
I modified the query return to reflect the “Value”/“Label” headers but cannot get the options to populate. I tried making a Dataset Tag fed by the query and modifying the Tag type but then I get “String Found, Array Expected” for every row in the query.
How do I use a Perspective Dropdown?

The “Objects Found, Array Expected.” error can be safely ignored. We have an open ticket to re-word that warning or remove it completely. Essentially it is telling you that the dropdown.props.options property expects an array of objects (which each contain a “value” and “label” property), but early on we failed to expect Dataset datatypes as the supplied value. Since then we’ve coerced the Dataset datatype to fit the expected structure, but we didn’t remove the warning.

You might notice that binding the options doesn’t actually change the Dropdown’s appearance in the Designer, but it’s just because the props.value hasn’t changed. Even with the warning you’re encountering, you can set props.value to a known value from the dataset and your Dropdown will work.

I actually couldn’t find the internal ticket, so I opened a new one.

Thanks for the fast reply. I find it challenging to tell what is a bug with the release and what is my not using the features correctly.

With my dropdown, ignoring the object/array error, I am seeing the actual drop down box be blank. The box has 37 blank fields corresponding to my 37 records in the dataset. Bug or a binding an issue?

After attempting this I believe I hit a similar error because I had the binding return “Value/Label” as the headers but apparently it is case sensitive and should be “value/label”. This by chance what you are hitting also?

I’m successfully populating a dropdown with a dataset (using columns: “value” and “label”) and it is working as expected.
The designer indicates that it is an error with a red yield with exclamation mark.
The hover-over says “options: object found, array expected”
I’m using version 8.0.1 (b2019050708)

1 Like

Please read above

This issue was fixed in the 8.0.6 nightly build that was uploaded today (10/7)

Hi, Awalker,

I am using 8.1.2 Perspective, and just have this issue since yesterday. image Would you mind let me know someone has same issue? Thank you!

@qliu instances from an embedding component is NOT the same as options for a dropdown, and the same rules do not hold true. You must convert your data to the expected array type for the instances property.

The easiest way to do this is to change the Return Format from “auto” to “json” in the Query Binding dialog:

Thank you so much! It is working now!