I have a problem with the drop down node.
I make a query by SQL node to a Database table and I get the desired result. This result is then linked to a dropdown node, but I have a problem just in one case.
When the result of my query is an array with just one object like this:
in the dropdown list I don't see the result, like this:
while if the array contains more objects I don't have problem and see the list (result of my query).
The query works fine, the problem is in the shown dropdown list.
it returns an array of values ONLY if there are more than one IDs found in the payload array. Otherwise it is flattened to a single value (as you found out the hard way). I'm guessing that the dropdown node is always expecting an array of values, instead of a single string, which is why it's blank.
To force your expression to always return an array, try appending square brackets like this...
(I removed the leading $. since it does nothing):
payload.ID_Scad[]
This causes any matching output to be returned as an array, so 1 or more values -- if nothing is matched, then nothing is returned.
The other syntax you can use is to wrap the entire expression in square brackets:
[payload.ID_Scad]
so even if nothing is found, you will get back an empty array -- FYI