AnsweredAssumed Answered

Primary key or non replicated values for field

Question asked by kramstead_usfs on Jul 26, 2018
Latest reply on Aug 1, 2018 by Philip.Wilson-esristaff

Hi,  I am working on a Survey123 form that I created to collect information on trees within a plot.  For each plot I have created a repeat to enter tree data for data we collect on up to 23 trees within that plot.  One of the fields in the repeat is Tree Number, and each of those trees is given a number 1 through 23.  If we accidentally enter the same number twice (e.g., label 2 trees #20) we cannot distinguish between the two tree records for that plot.  After being unsuccessful in finding a way to make this field a primary key or find a calculation that would prevent replicated values in the Tree Number field I ended up using a cumbersome fix for last weeks field work.  What I ended up doing is adding a multi-select checklist so that the recorder could select the number of the tree under the plot information section, and then under the repeat for tree information the recorder would have to enter that same number into a text field.  So the data has to be entered twice.  (See example of form below)

 

 

This method works in a pinch but is not ideal.  Is there a solution to either:

1 . Make Tree Number a primary key. 

2.  Prevent replicate values in tree number.

3.  Use a calculation that references the Tree Number entered under the repeat to autoselect the same number in the multi-select  under the plot information.

 

In some ways it would be nice to have the ability to do either #1 or #2 and in addition still have the multi-select (but one that is autopopulated as you enter tree number data).  This would prevent accidentally entering the same number twice under Tree Number while allowing the recorder to follow which trees in the plot still need data collected from them. 

Outcomes