Checkbox Tree - How to setValue

How to fill/check a checkbox tree component with values (not the json structure) from database as simple as setValue?

1 Like

Hey @davidls – unfortunately the JSON structure is the only way to update values in a checkbox tree. You could create a JS query that runs through a loop and pulls in the right database values though!

@justin How is this accomplished in the JSON structure? In the example docs, it shows something to the tune of:

  label: "blah"
  value: 123,
  children: []

for each node, but it doesn’t indicate how to define which elements should be selected.

The “default values to check” field lets you supply, well, default values to check. So you could set this dynamically using {{ insert javascript here }}.Screen Shot 2020-07-15 at 7.04.14 AM