I want to hide a custom field if there is nothing in another custom field that is a Text Field (multi-line).
I am trying to use the behaviour plugin, but can't figure out how to check if a text field is empty.
How would I validate against the Text Field to see if it is empty?
You script would look like this
def multiLineField = getFieldById(getFieldChanged())
def fieldToHide = getFieldByName("field to hide name")
if (multiLineField.getValue() && !multiLineField.getValue().toString().isEmpty()) {
fieldToHide.setHidden(true)
}
else {
fieldToHide.setHidden(false)
}
Thank you! This got me on the right track.
I changed this line:
(multiLineField.getValue() && !multiLineField.getValue().toString().isEmpty())
To
(multiLineField.getValue().toString().isEmpty())
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.