Formula once(count(${FIELD})) no longer working within a Repeat

358
1
06-28-2022 05:32 AM
PatMannix
New Contributor II

Hello,

Using the latest version of Survey123 Connect, the Formula to count repeats (within a question in a repeat) no longer works. The counter now starts at "0" instead of "1". Every time a new record within the repeat is added it is one behind the expected value e.g. the string output for Unique Fish ID ${ticketNumberDisplay} ends with _0 instead of an expected  _1

once.jpg

The formula in question is 

once(count(${FIELD}))

 

Originally found the working solution here via a blog https://esri-southafrica.blog/2017/12/14/survey123-with-a-single-attribute-for-repeating-generic-que...

But also via a solution proposed by @JamesTedrick here https://community.esri.com/t5/arcgis-survey123-questions/survey123-connect-running-count-calculation... 

Similar to question answered by @Anonymous User here https://community.esri.com/t5/arcgis-survey123-questions/calculation-no-longer-updating-after-3-0-to-3-2/m-p/832297#M18733

 

Thanks for any help.

Kind Regards, Pat

Tags (3)
1 Reply
DougBrowning
MVP Esteemed Contributor

Yes this was a trick I posted about and used in many forms but it broke.  I switched to using position(..) or if you have multiple repeats position(${repeatname}).  

Note just like once(count()) it is not perfect.  Mainly if a user adds 5 repeats, then goes back to say repeat 2 and deletes it, then adds a new point, you will now have two number 5s.  This assumes you used once.  If you do not use once then if you scroll through the repeats it may or may not update.  You can use the new calculation modes and get them to all update but then the users would have to scroll through all of them.  Even the new always calc setting does not seem to fire unless the user views each repeat.

Looking at what you posted once(count(${FIELD})) + 1 may do it also?  Same issue though using once.  If they go back and delete it causes a mess.  We trained our crews to not go back through and delete but instead just changes the value.

Hope that helps.  It was as good as I could get it.