Validate if multi-select form field is empty

Adrian M 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

1 vote
Answer accepted
Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 2, 2024
!MyList:[empty]

 

Alex Medved _ConfiForms_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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 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_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 4, 2024

Do you have multiple validation rules?

Adrian M 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_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
April 5, 2024

Remove the value from the "Field name" parameter

Adrian M 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_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
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

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events