Avoid Duplicate within a form

Hi,

I am designing a form for collection data in agriculture. I am looking for
a way to avoid duplicate entry in my form. my form has a integer variable
"Plot_Num" to store the number of the plot for a farmer, and four
additional select one variable "Crop1", "Crop2","Crop3"and "Crop4" to store
the crops. I don't want to allow any crop to be selected twice. For
example it a crop "Maize" have been selected in one field, the form should
not allow again to select the crop "Maize" again.

Any help ?

Best

You have two options, constraints or choice_filter.

  1. If you use constraints, for Crop2, you would have ${crop2} !=
    ${crop1}. The form would alert and stop the user from continuing.
    http://xlsform.org/#constraints

  2. If you use choice_filter, you'll have a select of all the options,
    then each following question would hide the previously selected
    option. I like this method the best and I've attached an example. It
    works for select_ones and select_multiples.

Yaw

select_multiple_filter.xlsx (10.8 KB)

··· On Thu, Feb 16, 2017 at 11:55 PM, Bigirimana Florent wrote: > Hi, > > I am designing a form for collection data in agriculture. I am looking for a > way to avoid duplicate entry in my form. my form has a integer variable > "Plot_Num" to store the number of the plot for a farmer, and four additional > select one variable "Crop1", "Crop2","Crop3"and "Crop4" to store the crops. > I don't want to allow any crop to be selected twice. For example it a crop > "Maize" have been selected in one field, the form should not allow again to > select the crop "Maize" again. > > Any help ? > > Best > > -- > -- > Post: opendatakit@googlegroups.com > Unsubscribe: opendatakit+unsubscribe@googlegroups.com > Options: http://groups.google.com/group/opendatakit?hl=en > > --- > You received this message because you are subscribed to the Google Groups > "ODK Community" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to opendatakit+unsubscribe@googlegroups.com. > For more options, visit https://groups.google.com/d/optout.

Tanks a lot, I used option one, it is simple and working fine.

Tanks

··· On 21 February 2017 at 02:52, Yaw Anokwa wrote:

You have two options, constraints or choice_filter.

  1. If you use constraints, for Crop2, you would have ${crop2} !=
    ${crop1}. The form would alert and stop the user from continuing.
    http://xlsform.org/#constraints

  2. If you use choice_filter, you'll have a select of all the options,
    then each following question would hide the previously selected
    option. I like this method the best and I've attached an example. It
    works for select_ones and select_multiples.

Yaw

On Thu, Feb 16, 2017 at 11:55 PM, Bigirimana Florent florentbigira@gmail.com wrote:

Hi,

I am designing a form for collection data in agriculture. I am looking
for a
way to avoid duplicate entry in my form. my form has a integer variable
"Plot_Num" to store the number of the plot for a farmer, and four
additional
select one variable "Crop1", "Crop2","Crop3"and "Crop4" to store the
crops.
I don't want to allow any crop to be selected twice. For example it a
crop
"Maize" have been selected in one field, the form should not allow again
to
select the crop "Maize" again.

Any help ?

Best

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups
"ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to a topic in the
Google Groups "ODK Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/opendatakit/wtbLSkTdtNk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
BIGIRIMANA Florent
GIS Specialist
National Institute of Statistics of Rwanda
AV de la Justice/Muhima
Kigali/Rwanda
Tél 0788748944/0728748944