I have a googlesheet with Columns A - P. Column B (GROUP) is a dropdown list and Column N (EXECUTION STATUS) is a drop-down list. I am trying to automatically set a particular value in a cell for GROUP based on the value that I selected in the EXECUTION STATUS dropdown list.
For Example:
GROUP has the following values in the drop-down list:
DEVELOPER
QA
LEVEL 1 SUPPORT
LEVEL 2 SUPPORT
EXECUTION STATUS has the following values in the drop-down list:
PASSED
FAILED
NOT EXECUTED
BLOCKED
Here is what I want to happen:
If I select FAILED as the EXECUTION STATUS, I want the GROUP to automatically change to DEVELOPER.
Here is my function:
function changeGroup(event)
{
var ColN = 14; // Column Number of "N"
var changedRange = event.source.getActiveRange();
if (changedRange.getColumn() == ColN)
{
// An edit has occurred in Column N
var state = changedRange.getValue();
var Group = event.source.getActiveSheet().getRange(changedRange.getRow(),ColN-12);
switch (state)
{
case "FAILED":
// Select DEVELOPER from dropdown list
Group.setValue("Developer");
break
}
}
}
Copyright Notice:Content Author:「destiny931」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/60793222/how-to-automatically-set-a-value-in-drop-down-list-based-on-a-value-from-another