How to enable the function 'Allow multiple selections" in data validation which created by app scripts

I have a issue with my data validation; my client requests a function: fetching data from the server and filling the response into the dropdown (requiring allow multiple selections). But when I use requireValueInList to generate the dropdown, I can't find any option to enable that. (I attached 2 images below)

const rule = SpreadsheetApp.newDataValidation()
  .requireValueInList(['Yes', 'No'], true)
  .build();
sheet.getRange(4, index + 1).setDataValidation(rule);

data validation created by app scripts

data validation created by data > data validation in menu bar

Upvotes: 1

Views: 155

Answers (1)

Wicket
Wicket

Reputation: 38416

You should manually change the Display Type from Arrow to Chipset. This is because the "Allow multiple selections" is only available for this type of display.

It's worth mentioning that Using Google Apps Script, it is impossible to change the Display Type and set the option to Checked.

Upvotes: 0

Related Questions