Home > Back-end >  Creating a dropdown using Google Apps Script. Is the method for changing the colours missing or not
Creating a dropdown using Google Apps Script. Is the method for changing the colours missing or not

Time:01-13

Screenshot

I'm hoping someone could confirm if this functionaility is not yet available. I'm having trouble finding the correct method or technique to apply colours to a dropdown using Google Apps Script as shown in the image attached.

I've been able to create the dropdown using a simple function as shown below. I've been using the Google Apps Script References Help but nothing stands out to me.

function createDropdown() {
  var sheet = SpreadsheetApp.getActiveSheet();
  var cell = sheet.getRange("F2");
  var rule = SpreadsheetApp.newDataValidation().requireValueInList(["-", "Go", "Stop"]).build();
  cell.setDataValidation(rule);
}

If anybody could perhaps point me in the right direction or confirm it's simply not possible, that'd be really appreciated! :)

Thank you

I've tried the built in autocomplete to see if other methods appear that don't yet appear in the documentation.

CodePudding user response:

You are right, at this time Google Apps Script doesn't support setting the data validation style and format settings. Keep an eye on the Relese Notes to learn when these new UI features be added (the might appear earlier in the autocomplete but not necesarily will be working for all users even if they are visible for all).

  • Related