The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Validate if multi-select form field is empty

Adrian M
Contributor
April 2, 2024

I have a multi-select dropdown in my confiforms form. I need to validate that it isn't empty when submitting the form.

Neither of these rules validate that in the rules macro as I'm able to submit the form:
MyList.asSize:0
MyList.asSize:<1

How can I validate that at least 1 selection was made.

2 answers

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Answer accepted
Alex Medved _ConfiForms_
Community Champion
April 2, 2024
!MyList:[empty]

 

Alex Medved _ConfiForms_
Community Champion
April 2, 2024

But of course you need to have the validation rule that checks for "erroring condition", so it needs to be

MyList:[empty]
Like Adrian M likes this
0 votes
Adrian M
Contributor
April 2, 2024

Thanks @Alex Medved _ConfiForms_ .

The validation works but a strange quirk shows up. There is only one validation rules macro. But the validation error message from it shows up twice on the top of the form. Any idea why that is and how to prevent it? 

Alex Medved _ConfiForms_
Community Champion
April 4, 2024

Do you have multiple validation rules?

Adrian M
Contributor
April 5, 2024

There is only one rule. But two conditions in the same rule. The error message is "MyList is required".

I did a test by making a change to the message and the new message showed up twice. 

image.png

Alex Medved _ConfiForms_
Community Champion
April 5, 2024

Remove the value from the "Field name" parameter

Adrian M
Contributor
April 5, 2024

Thanks. That fixed it. I overlooked the info under the field name param "leave blank when you configure validation rules, as these rules are applied on form submit"

Alex Medved _ConfiForms_
Community Champion
April 5, 2024

We should also make this work better in this case... (ignoring the parameter altogether - will make a note)

Like Adrian M likes this
TAGS
AUG Leaders

Atlassian Community Events