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!

 

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
TAGS
AUG Leaders

Atlassian Community Events