Tree View Options From Table

Hello,

Context:
My app will provide functionality for individuals working with multiple companies/clients. Each company has a variety of different data sets associated with it via tables.

Problem:
I’m trying to connect a drop down button with the “companies” that’s associated with the logged in user. The user can create/add companies on a seperate page but not on the drop down menu I want to build. The drop down menu I’m trying to create here will only be so the user change the data set they’re looking at or using. Also I would like to have the default selection be the most previous one the user selected.

Currently, I’m trying to use the Tree View tool and I’m not having success.

Questions:
Is their a better way to approach this?
If this is the optimal route, what do I need to change in my logic to make the options (“companies”) appear? See screenshots for more context.



Thank you,
Austin

Hi Austin,

It wasn’t clear to me where Tree View comes into play in your UI. I see the logic for populating a list of companies in a drop-down component. Does it work for you? Let’s focus on that first.

Regards,
Mark

Hi Mark,

Thanks for helping out with this. The logic for populating the list does not work. The screenshot above is the attempt I have so far. The Tree View does not need children so I could probably have used the “select” drop drown tool instead. I found this component easier to work with since the select dropdown component is used better for inputting info in a form. (Not sure if this assumption is correct or if I should try that route again instead)

Focusing on the logic for the tree view drop down, I’ve also tried to remove the “value” return object in the bottom right of the logic posted above and that did not work either.

Thanks again,

Austin

Hi Austin,

I think the select drop-down would be a better option. Tree Views tend to go away with the mobile-first initiatives taking over.

Regarding populating the drop-down with data, please take a look at the following how-to article:

Please let me know if you get stuck.

Regards,
Mark

1 Like