0

First off, Cognito forms is awesome.. Amazing tool.

I have a club selection and a waiting list selection. I want people to be able to put their name down on the waiting list if there are no places... but not to accidentally add themselves if they've already chosen a club with spaces.

Im having trouble getting multiple repeating sections to block duplicate entries from a dropdown.

The code Im using works if there is only one option selected. See image - the error comes up.

=(WaitingClub.Contains(Form.SelectYourClubOptions.Select(Choice))

If however if add a second entry to the first section, the validation no longer works.

enter image description here

The second image shows two clubs added. It submits! But football already chosen Problem.

enter image description here

0

All you need to do is switch your terms. Change this,

=CHOICE.Contains(Form.REPEATING_SECTION.Select(OTHER_CHOICE))

to

=Form.REPEATING_SECTION.Select(OTHER_CHOICE).Contains(CHOICE)

the correct calculation being.

=String(Form.SelectYourClubOptions.Select(Choice)).Contains(WaitingClub)

The reason it was not working was because the String, "Football, Football" is not contained within the String "Football"

You can experiment with this yourself

="Hello".Contains("Hello, Dolly")

vs

="Hello, Dolly".Contains("Hello")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.