Coder Social home page Coder Social logo

gsheet-multiselect's Introduction

GSheet-MultiSelect

Script to add Google Sheets MultiSelect fields from dropdown selections.

gsheets-multiselect - Google Sheets MultiSelect - @ControlAltPete 2023

Allow cells with data-validation to have multi-select. The cell should have data validation from a range and the cell immediately above that validation range must contain: MultiSelect:ShowInCell or MultiSelect:ShowRight or MultiSelect:ShowBelow

The default item separator is "value1, value2" but this can be changed by adding ",Sep=" to the MultiSelect cell, eg: MultiSelect:ShowInCell,Sep=| If the Sep has a comma or spaces you need quotes, eg: MultiSelect:ShowInCell,Sep=" , "

The special values '' (blank) 'None' and 'All' will replace all previously selected values.

Google Sheets will show a warning triangle when multiple items are selected, This warning shows for ShowInCell but not for ShowRight or ShowBelow. To hide this warning, add ",HideWarning" to the MultiSelect cell, eg: "MultiSelect:ShowInCell,HideWarning" but be aware this will add a new dropdown option with all the current selected items ie: the dropdown: 'Apple' 'Banana' 'Cherry' can become 'Apple' 'Banana' 'Cherry' 'Apple,Banana' A limitation of HideWarning is it can only hide the warning for ONE input cell If multiple input cells share the same data validation range and have different multi-select choices only one of them will have the warning triangle hidden at a time.

I have a demo sheet you can copy and play with here: https://docs.google.com/spreadsheets/d/1Uu2p6xP_oG3iE3XffpXBxAYsPyRFdvO8aDVaWSOjDMM/edit#gid=0

Installation: Google Sheet, click on Extensions > Apps Script, paste this. You may need to allow some permissions when it runs.

demo image1 demo image2 demo image3

gsheet-multiselect's People

Contributors

petertheobald avatar

Stargazers

Julie Vera avatar Shaked Lokits avatar Patrick Kastner avatar  avatar Alice Gao avatar  avatar Drew avatar  avatar Catherine Davie avatar Ngoc avatar Greg Gamel avatar David Norton avatar  avatar Kaska Miskolczi avatar  avatar Alekz avatar

Watchers

 avatar

gsheet-multiselect's Issues

Newline as separator not working?

the script notes that newline would be supported:

// Newline in quotes is a valid separator to have each item on its own line.

I've tried single and double quotes
Sep="Newline"
Sep='Newline'

And it's just returning those Newline strings as the separator. Am I doing this wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.