Question regarding selection of objects with dropdown

Hi there

Let’s say I have many objects with cars. One property is manufacturer, eg Audi, BMW ect.

I would like to have a dropdown. When selecting Audi, only show objects with property Audi.

Now I don’t know how many manufacturer I have stored. So how could I generate a dropdown which first groups the manufacturers, makes a list out of them which I then could have as a dropdown.

:wink: Hope this makes sense. Sounds a little bit confusing I believe…

thanks for the help
Andreas

Hi, if you have a list of objects with manufacturer fields you can do:

UNIQUE_BY_KEY(data.myList, manufacturer)

MAP(<previous formula here>, {label: item.manufacturer, value: item.manufacturer})

2 Likes

Hi @Mari

Thanks a lot. I am running into one problem: Now the dropdown only shows me the first item instead of running though all objects. It’s probably a syntax issue. I tried with this:

MAP(UNIQUE_BY_KEY(appVars.UserLogs, Method), {label: item.Method, value: item.Method})

So appVars.UserLogs stores the objects. Method is the filed in it.

Thanks for help
Andreas

I think what’s missing are quotation marks around "Method" in UNIQUE_BY_KEY. Does that fix it?

1 Like

that’s the solution, yes :slight_smile: Thanks a lot for your help

1 Like

@Mari and a follow up question: How would I need to approach it now with the dropbox:

it lists me correct all the “Method” there are.

What I want to achieve is: When Method A is selected, repeat only objects below with that “Method” in it.

What’s the approach? I am uncertain

Thanks again for your help! It is super much appreciated
Andreas

Solution

2 Likes