Select to view content in your preferred language

How Can I Prevent Repeated Use of a value in a Select_One List?

356
1
03-26-2024 07:49 AM
KarlMauch-CDA
Emerging Contributor

Survey Basics: 

  • Inspection Form for conducting regulatory inspection
  • Page 1 has Owner Number input section.KarlMauchCDA_1-1711462029908.png

     

  • When an Owner Number is populated available contact information is pulled from a CSV file as can be seen above.
  • In the Choices tab (Survey123 Connect) I have listed all the OwnerNumber to UnitID (name) matchups as seen below.KarlMauchCDA_2-1711462206967.png

     

  • So when a user selects an OwnerID on Page 1 it reduces the UnitID options on Page 2 to only those applicable. These show up as Legal Descriptions.KarlMauchCDA_3-1711462304749.png

     

  • Page 2 has a Repeat as the inspector many times has to inspect multiple UnitID for the same OwnerNumber. I also have a few additional fields being prepopulated from the CSV when the inspector selects a specific UnitID.KarlMauchCDA_4-1711462566349.png

     

  • I'm hoping to make this form function so that when the inspector finishes their inspection of the selected UnitID and adds another record using the Repeat, that any previously selected UnitIDs are not available. 

Any advice?

 

0 Kudos
1 Reply
DougBrowning
MVP Esteemed Contributor

Very common question.  You cannot remove items from the list.  The best you can do it stop them from adding another repeat with the same value.

There are 2 ways.

First uses join to make a list of values that you then check against.

See my code here https://community.esri.com/t5/arcgis-survey123-questions/repeat-duplicate-preventer/m-p/1155978#M414...

https://community.esri.com/thread/229555-how-to-not-use-a-list-item-more-than-once 

The other way uses javascript.  

See the code here  https://community.esri.com/t5/arcgis-survey123-questions/counting-quot-unique-quot-selections-across...

From https://community.esri.com/t5/arcgis-survey123-questions/in-a-repeat-section-remove-already-selected... 

Hope that helps