How to set default values in checkbox

I have this object

coverageInfo = [
  {technology: '2g', color: '#984ea3' },
  {technology: '3g', color: '#4daf4a' },
  {technology: '4g', color: '#377eb8' },
  {technology: '5g', color: '#e41a1c' }]

And i can’t set default checked values in this variable:

viewof technology = Inputs.checkbox(coverageInfo, {description:"hi", value: ["2g", "4g"], label: html`<b>Red Internet Móvil</b>`, format: x => html`<span style="text-transform: capitalize; border-bottom: solid 3px ${x.color}; margin-bottom: -2px;">${}`})

What am i doing wrong?
Here is the notebook in case you need it:

The input considers the objects in coverageInfo to be the values, so you have to preset them as follows:

  value: coverageInfo.filter(d => ["2g", "4g"].includes(,

Alternatively you can add valueof to your input:

  valueof: d =>,

That way the array in the returned input’s value will only contain the technology values.

1 Like