Initializing an Array from Dynamic Data in the Toolbox Javascript window

Is there a special way I need to initialize a variable in my Javascript code if I am trying to fill it with a list of values from my Bubble database?

Current I have it setup this way.

let foodNames = Search for Foods:each item’s Type

Foods is my database type, and Type is the field. There are about 70 different items in the Type field right now and I want to send them into an array in my code so I can do some analysis on it.

But it doesn’t appear to recognize the new array because it wont show up when I send foodNames to the console.

What am I doing wrong?

Anyone have any ideas here?

Hi @david62

Did you find a solution?