Iterating over an hash to make an array of values inside a dropdown


This is probably an easy question just regarding JS available inside a small box.

I’m attempting to add data to my Postgres DB using data I’m fetching from an API to create new records from a dropdown.

I’ve almost got it working, I’m just having a bit of a hard time figuring out how I can iterate over a hash inside the values and display_value box in a dropdown component.

I’m able to fetch one value with [{{[i]}}] this works fine, for one value. I’m just not sure how to map it properly so I can get all the values, eg I tried:

[{{ => items[i]}}] but I get error in template, map is not a function.

Any suggestions would be helpful.


Hey @holden, and welcome to the forum! To help you I’ll need a better sense of the structure of - what does that look like? In general, the Dropdown component expects an array of values for the Values input. So something like => or maybe Object.values( could work.

1 Like

Your first one works! I thought it would be simple.

Thanks for that.


Haha awesome!