Forums

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

JMWE Live Fields - make field B visible based on field A selected value

Ricardo.Gomes
Contributor
February 6, 2026

Greetings there!

Use Case - 

So field A is a single select containing only two options: "Yes", "No".

Field B is a paragraph field.

 

Expected behavior -

- If user selects "Yes" in field A, field B becomes visible. Otherwise, if field A is "No" or empty, then field B is hidden.

Simple, right? :) But I can't get it to work! 

 

The following script works when Field A is a multi-select, but not for a single select.

(function() {
var field = getFieldById("customfield_A");
var values = field.getValue();

if (values && values.length > 0 && values.some(function(v) {
return v.value === "Yes";
})) {
getFieldById("customfield_B").setVisible(true);
} else {
getFieldById("customfield_B").setVisible(false);
}
})();

 

So on attempting to make thids work I thought this should, but it doesn't for some reason:

const selected = getFieldById("customfield_A").getValue(); // null | { id, value }
if (selected?.value === "Yes") {
getFieldById("customfield_B").setVisible(true);
} else {
getFieldById("customfield_B").setVisible(false);
}

 

Any insight will be greatly appreciated.

Cheers!

 

1 answer

Suggest an answer

Log in or Sign up to answer
0 votes
Avinash Bhagawati _Appfire_
Community Champion
February 8, 2026

Hi @Ricardo_Gomes ,

Thanks for posting this. I'm Avinash, from Appfire's Product Support team.

Please use the sample script below. When the single select field value is "Cloud", it will display another field. If the value is empty or not equal to "Cloud", it will hide the field. Remember to change the custom field ID according to your instance.

const customField = getFieldById("customfield_10094"); 
const customfieldvalue = customField ? customField.getValue() : null;
if (customfieldvalue && customfieldvalue.value === "Cloud") {
getFieldById("customfield_10096").setVisible(true);
} else {
getFieldById("customfield_10096").setVisible(false);
}

 

Please let us know if you have any additional questions.

Thanks,
Avinash
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events