I have a repeat question in my survey as shown below.
The repeat question is to document the plant species and cover class in a quadrat. There are over 200 values for plant species and many species may be found in a quadrat. Is there a way to prevent a plant species from accidentally submitted multiple times in the repeat question?
Solved! Go to Solution.
I think your issue is the Other. That will repeat a bunch of times.
I do this exact thing with species actually. We use Unknown Codes but same concept. You will have to build in an exception for the Other.
I did not test it but I added my line into your form. You could change my exceptions from UNK to Other.
Thanks for sharing, James. I am not familiar with JavaScript functions, could you please provide a little more detail?
Hi Lauren,
In the survey is a custom function that compares the number of answers with the number of distinct answers and returns true if they are the same and false if they are not. I based it on https://codeburst.io/javascript-array-distinct-5edc93501dc4
Hi James,
Thanks for your response. I added the note to my survey and added the extensions folder with the javascript file to my survey content folder. However, now the note about duplicate values is always appearing. Do you have any suggestions?
Hi Lauren,
The pulldata expression needs to be in its own hidden calculation, and then reference that question name in your relevant expression for the note.
It will not work the way you have currently tried to use it in the note.
Phil.
Thanks, Philip. Did I do this correctly? The duplicate value warning is still showing up all the time.
Hi Lauren,
No, this is not correct. You need to remove the not and separate that to a different question from the pulldata.
Can you attach your xslx file so I can take a closer look and work out the best way to achieve what you are after.
Phil.
I think your issue is the Other. That will repeat a bunch of times.
I do this exact thing with species actually. We use Unknown Codes but same concept. You will have to build in an exception for the Other.
I did not test it but I added my line into your form. You could change my exceptions from UNK to Other.