Auto-Refresh/Advance All Repeats

452
2
01-23-2023 06:02 PM
DustyJordan
Occasional Contributor

I'm wondering if there is a way to have a series of repeats either all refresh their data/calculations, or somehow advance automatically through a predetermined number of repeats? 

I have a form for servicing assets located at various sites where each asset is recorded as a repeat. If the asset is inaccessible this is then noted in the repeat. Sometimes an entire site will be inaccessible for reasons, and thus all assets within that site need to then be noted as inaccessible. This can be kind of tedious for the user when they have to individually create and page through several repeats and select "inaccessible." In order to help reduce the tedium I've used a combination of repeat_count, if(selected()) and pulldata() calculations in order to prepopulate not only the number of repeats (i.e., assets) at that site but also mark them all as 'Inaccessible' if a previous null field checks out to 'Site Inaccessible=Yes'.

So far this works great, however I'm noticing that I still have to actually page through all the repeats in order for the calculations to all fire. Ideally I would like it so that as soon as they select the site name and 'Site Inaccessible=Yes', they can just submit the data. 

 

0 Kudos
2 Replies
DougBrowning
MVP Esteemed Contributor

I assume you have tried the calculation modes set to always?  https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-calculation-modes/...

I still think you may need to have each repeat show for that to fire though.  It has to do with the way 123 works.  It has each repeat there in memory as you scroll.  The rest of them are not loaded.  Similar issue to loading the last repeat value.  The display has FieldA in repeat 1 but it cannot call FieldA in repeat 2 because the field name is the same.  The engine works on field names so it cannot run 2 fields As at the same time. Like having two people named Bob in the same room - if you just yell Bob how does anyone know which one you mean?  Hard to explain so I hope that makes sense.  The other issue would be imagine 100 repeats have to all fire at once - and several fields in there.  Too much for the memory of the tablet.  Earlier versions of 123 we would blow out the memory with repeat count all the time.  

What may help is I have a form with a "defaults" page.  The user can set several values then in each repeat I have a Use Defaults? button that then fills in several fields for them all at once.  That may help?

DustyJordan
Occasional Contributor

Hi Doug, thanks for the response!

I'd heard of calculation modes but hadn't messed around with those yet. I read the linked article and tested some of the settings on my repeat and various fields, but none of those seemed to help. I think you're right in that the empty repeat records are generated, but the calculations don't fire until the repeat becomes active and is loaded. 

The defaults thing is essentially what I'm doing. There is a checkbox field outside the repeat and when selected it fills in some default answers within each repeat. Although the user still has to page through each repeat, the fact that they no longer have to fill in answers to for each repeat record is a big improvement, which I'm happy with. Was just hoping I could take it one step further. 

Thanks for the suggestions!