I have a feature service that is made up of a point layer and a related polygon layer. Using the repeat count formula, I generate a Field ID for and polygons that are added. The Field ID is a concatenation of a Site ID attribute and the repeat count. For example: OSRI24_1234_1, OSRI24_1234_2, etc.
This works great! The problem begins when a user reopens a previously submitted survey through the Inbox. Let's say the Status of the work needs to be updated or cropping information needs to be updated. When the user opens the survey, the Field IDs automatically get changed. Using the Field ID examples from above, if I wanted to edit OSRI24_1234_1 record it has now become OSRI24_1234_2 because it's still using the concatenate calculation.
So technically it is doing what I told it to do but at the same time it is over writing the original "correct" ID with the wrong ID.
How do I preserve that original Field ID that was captured?
Is there no way to access the repeat count from the Survey123 app itself? It's clearly stored and displayed correctly here.
The screen grab below illustrates my issue. In this example I'm looking at the first repeat that was added but the Field ID is DanB_Test_2.
So, I basically cannot edit any of my data while using Survey123's Inbox.
Any assistance or suggestions would be greatly appreciated.
Thanks
Solved! Go to Solution.
How do I preserve that original Field ID that was captured?
Have you tried calculationMode=whenEmpty
repeat count
use count(${your_repeat_name}) outside of the repeat
How do I preserve that original Field ID that was captured?
Have you tried calculationMode=whenEmpty
repeat count
use count(${your_repeat_name}) outside of the repeat
My repeat count is definitely outside the repeat.
As for your initial suggestion, I honestly have not tried that. I had never heard of calculation modes before.
Survey123 Tricks of the Trade: Calculation modes (esri.com)
After doing some research I implemented your suggestion with a minor tweak. I used calculationMode=auto and it seemed to fix my issue. I'll monitor it over the next couple days, but I am very optimistically hopeful.
Thank you very much for the suggestion and help.
Cheers!
~Dan
I use once(count()) and it has been the most consistent over the years.
Note it will never be perfect. If a user goes back a few repeats and deletes a record the next one they create will be a dup.