Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

A same field should populate based on other 2 field values

PS July 6, 2020

Hi Folks,

I would like to Auto-populate a field based on other field values?

But here there is one challenge, the same text field should get populate when we select A & B values from the other field.

Here it is working only with one field value either A or B.

How should I make it work for both field values.

The script

def textField = getFieldByName("Data-Domain")
def selectList = getFieldByName("Sub-Issue Type")

def selectListValue = selectList.getValue()

if (selectListValue == "A")
{
textField.setHidden(false)
} else {
textField.setHidden(true)
}

 

If I write the same script for B value 

def textField = getFieldByName("Data-Domain")
def selectList = getFieldByName("Sub-Issue Type")

def selectListValue = selectList.getValue()

if (selectListValue == "B")
{
textField.setHidden(false)
} else {
textField.setHidden(true)
}

The Data-Domain is populating only for B value where as it needs to populate on both selections A & B.

Please suggest.

0 answers

Suggest an answer

Log in or Sign up to answer