How to prefill the content of dropdown from a query?

Is it possible to prefill the dropdown from a query?

I have a query and want to fill up the dropdown with the result of the query (unique products in the table)


Is something like this what you're looking for?

Screen Shot 2020-05-18 at 8.30.03 AM

1 Like

You’re the best!. Exactly! Thanks.

1 Like


1 Like

@kent This isn't working at all for me :frowning: This is what I see when I reference the query I made. Am I doing something wrong here?

Hi @scottamesmessinger!

Some queries (usualy SQL based ones) return data as an object of arrays like this:
{ key1: [val, val], key2: [val, val] }

Which would make the selection of all of the values in an array easy as shown above,

Many other data sources return an array of objects like this:
[ { key1: val, key2: val }, { key1: val, key2: val } ]

For this, you could either get the array of all of a certain value by using the .map() JS method, or converting it to an object of arrays using our helper function formatDataAsObject() (there’s also the opposite as formatDataAsArray). That would look like either:>d.key1)

1 Like

That is wonderful!!! Thanks so much for helping me with that!!!

1 Like

thanks a lot!!!

1 Like