Can I prevent a value from being submitted multiple times in a repeat question?

8777
35
Jump to solution
06-14-2019 11:30 AM
LaurenMcGarvey
New Contributor II

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?

0 Kudos
35 Replies
DougBrowning
MVP Esteemed Contributor

Plant codes mostly from USDA yes.  How I do it is to have the full scientific and common name in the label but just the code in name.  That way you can search for anything and it comes up but only the code stores in the data.

Like this - just search spruce and you get it.  Works great no matter what part you know.

List name  Name    Label

PlantsList  PIEN      PIEN Picea engelmannii Engelmann spruce

I have a running list  below the repeat as well.  Mostly since I have the list to check for dups anyway.  If you are submitting multiple forms then it would not work across forms of course.

We are doing an inventory so just mark you saw it.  My repeat check handles dups.

We also have a Line point intercept and used to worry about how to port that over to the inventory.  But in the end we decided to just do that when we ingest to the backend SQL.  We combine all plant sources and store that as a feature class so we can map it.  Way easier in the end to just combine for people.

Hope that helps not sure what your question is now?

0 Kudos
JosephBusalacchi
New Contributor

This solution works as long as I am in the same repeat, as soon as I advance the survey to the next plot on the transect, the list disappears.  Any ideas on how to get the species list to remain persistent for the entire transect (10 plot repeats)?

I could send you a copy of my .xlsx file if that would help?

0 Kudos
DougBrowning
MVP Esteemed Contributor

Try wrapping a join or concat around the 10 fields.  Then use that to check.  Or maybe put the join outside the repeats.

0 Kudos
DougBrowning
MVP Esteemed Contributor
S_-_EvanRaskin__GISS_
Occasional Contributor

The JavaScript function worked great for me once I figured out that I needed to create an "extensions" directory in my survey to house repeats.js. This solved a lingering question that I had from two years ago.

0 Kudos
EvanR
by
New Contributor III

That is, it worked great in the Survey123 Connect preview. As soon as I got it into the field app I started getting "scripts disabled" messages.

Edit: just realized that I am responding from a different account, sorry for the confusion.