Insert Data Validation using Google Apps Script

drop-down-menu, google-apps-script, validation

Solution

An Apps Script API for data validation was just released: http://googleappsdeveloper.blogspot.com/2013/08/answering-another-top-request-data.html

Related references:

- Drop-down validation list created dynamically (google apps script)

- https://code.google.com/p/google-apps-script-issues/issues/detail?id=2958

- https://code.google.com/p/google-apps-script-issues/issues/detail?id=219

Problem

I'm trying to insert an in cell dropdown menu (Data > Validation > List of Items) in a Gsheet using Google Apps Script. I want to do this because every time I use the spreadsheet the 'list of items' will change slightly and I don't wanna have to go to "Data > Validation > List of Items" every time I open the spreadsheet. I'm aware that "Data > Validation > List from a Range" exists but I'd rather not use it.

Original source