Is there a way to expand all checkbox tree keys by default?

I have categories structure, it can be up to 4 levels. I also have an ability to search particular categories through performing SQL query with entered category name. It works well, but I don't know how to expand all keys in the tree by default. I can only specify expandable keys by value I know already...

When search is performed:


I want to make it looks like this:

My checkbox tree values are dynamic (it contains category type + id) and I have a lot of categories (up to thousands) and that is very problematical to compose an array of the category values

Hello @danyloh!

Unfortunately I believe that the only way to currently expand the tree is with values that are pre-defined in the array which you give the component. But these values can be dynamically set with strings from other components!

I was just testing things out and you can definitely pass in the value of a string typed into a text input inside the expand array and it will dynamically expand to that checkbox.

Let me know if that works for you!

If you want to expand every single option:

You could try running a JS Query block to 'flatten' out the object which is the source of the checkbox tree to create an array of all the keys. This final array of keys could be saved in a variable and you can set the expand array value in the tree component to this variable.