I have a survey with nested repeats
Plot > Seedlings > seedling visit
When the restoration crew visits a plot (main feature) they need to visit each seedling (first repeat) and then add a record for the seedling visit (nested repeat). For the newest seedling visit I want to limit to only 1 NEW record.
Here is what I've tried :
Outside of the repeat I used an aggregate expression: ${repeatcount} = count(${VisitNo})+1
I then referenced that field in the repeat_count column : repeat_count=${repeatcount}
However, this constantly updates and adds new records everytime you move to the newest record.
Any suggestions?
I think you are looking for the once() function
Where do you see that fitting in to the workflow? How could I use the once() function to limit the amount of additional repeats permitted?
You can try once(count(${VisitNo})+1) but repeat count does not like being dynamic and may cause other issues. What I do is just have a field with a calc of count(${a_repeat_field}) and then put a constraint on that field. It has been much more stable for me. It will let you create one too many but then it gets trapped. I added a red note saying "Went too far delete this repeat" and the users have been fine with it.
Hope that helps.