Select to view content in your preferred language

Repeat Calculation Issues when Editing Data Through the Inbox

182
3
Jump to solution
a month ago
DJB
by
Regular Contributor

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. 

DJB_0-1728501987312.png

DJB_1-1728502097971.png

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.

DJB_3-1728502703412.png

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.

DJB_4-1728502929112.png

So, I basically cannot edit any of my data while using Survey123's Inbox.

Any assistance or suggestions would be greatly appreciated.

Thanks

 

 

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Frequent Contributor

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

View solution in original post

3 Replies
abureaux
MVP Frequent Contributor

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

DJB
by
Regular Contributor

@abureaux,

My repeat count is definitely outside the repeat.

DJB_0-1728518825736.png

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

0 Kudos
DougBrowning
MVP Esteemed Contributor

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.

0 Kudos