Repeat advancing with incomplete required fields

183
4
07-14-2021 10:58 PM
DustyJordan
New Contributor III

Hello,

I'm running into an issue while trying to use Repeats defined by a repeat count. After some Googling I found old posts here referring to this same issue after an update back in 2019. I guess I'm wondering if this has been addressed, or if there is a workaround.

TL;DR: repeats are advancing while a required field within the repeat is not being completed, meanwhile another required field is then NOT allowing the repeat to page back to the previous repeat record. 

I will try to keep a long story short here, but here is essentially what I'm trying to accomplish and the issue I'm running into. I have a number of assets that need inspecting on a weekly basis, and each asset has a unique scannable barcode. Unfortunately a lot of my field techs either can't or choose not to scan the barcodes the majority of the time. As you can image this introduces errors. I am trying to redesign my form to be practically error proof. To accomplish this I am using repeat count tied to the total number of assets at each service site in order to generate the actual number of assets they should be servicing at that location. No more, no less. I'm also attempting to include a select one list that populates with all the asset barcodes from that site. When they scan or otherwise manually enter the barcode, it should also populate the select one from the generated list. In other words, I'm trying to use this select one list to verify each asset barcode entry in the repeats. 

Unfortunately what I've noticed in testing is that the user can enter an asset barcode not on the list, which leaves the select one blank, and then can still proceed to the next repeat. With this select one required field failing to stop them from advancing to the next repeat, it essentially nullifies what I am attempting to accomplish. Furthermore, when I try to page back to the previous repeat, the required barcode field is triggering and not allowing me to return to the previous repeat. 

I'm wondering if there is something I am missing or perhaps a workaround that will help with what I am trying to accomplish? Alternatively, is there a way I could make it so the user can scroll back and forth at will across the pre-generated repeats and the required checks all happen at the end before submitting the record? 

Thanks in advance for any help or advice!

-Dusty

0 Kudos
4 Replies
DougBrowning
MVP Frequent Contributor

I have had lots of issues with repeat count, mostly since it loads all the repeats right away.  I have calc issues, memory issues, etc.  Not sure I have seen the required issue though.

In the end I removed repeat count and instead use a count and constraint.  I usually have some field hidden or not that has a point count using a calc of count(somerepeatfield).  Then a constraint on that so count = assets count expected.  That way they can grow the repeat but if they go too far or not far enough the constraint fires.

For the select one I assume you do this so they can collect in any order?  If that is the case what I did was check for any dups across the repeat.  See this post with 2 ways to do it - one uses join and the other uses javascript.

Restricting duplicates for a field during repeats - Esri Community 

Hope that helps

0 Kudos
DustyJordan
New Contributor III

Hi Doug,

Thank you for the response and suggestions! Sorry it took me awhile to get back to you about this. 

I decided to go your route and just use a dummy field in my repeat which is counted in another field on the main form. I then match that field to a value for total assets at the chosen service site which is pulled from a .csv and use a constraint to validate it. This works great and provides the same functionality that I was trying to achieve with the repeat count function, but with more flexibility it would seem. 

I am still running into one last snag though, unfortunately. While the above design does constrain my users from entering too many or too few repeats for their chosen service site, I still need to prohibit them from entering a combination of assets from varying service sites. This is what I was trying to accomplish with the required select one checklist. 

I've now switched to a read only select multiple list within the main form that pulls it's options from an external choices .csv based on their selected service site. This select multiple populates as they go, using a join function of the answers in their repeats. The snag I'm running into is that I can't seem to get a constraint on the select multiple checklist to work that equals the total number of assets at that site (used above in the repeat count workaround). 

It seems like a "count-selected(${Select_Multiple_Qstn})=${Total_Assets}" in the constraint field of the select multiple should work, but it isn't triggering the constraint. I'm wondering what I'm missing here, as this should be a pretty simple function.

I've attached a copy of my xls form, in case that helps.

Thanks again!

0 Kudos
DougBrowning
MVP Frequent Contributor

I usually make a note field then check for dups using the tricks I posted above.  That should work.  But what you have here looks like it would work too I think.

My first idea is I have seen constraints not work on a read only field.  Which kinda makes sense.  I would say change to note but then count-selected wont work.  Try removing read only to see if that is it.  Also no need to make it required.

My other idea is that ${Tube_Count} is being treated like a string.  Even when it is integer it can live as a string the form.  Try setting the bind type field to int.  

I cannot actually test any of this since you did not include the pulldata files and I don't have the barcodes.

Hope that works.

0 Kudos
DustyJordan
New Contributor III

I tried setting the bind type to Int, removing read only and required, but unfortunately I still couldn't get the conditional constraint to trigger on my select_multiple list. 

Eventually I just decided to make a constraint on the Site field in the repeat so that it must match the site they have selected in the main form. This should at least restrict them from entering barcodes from the wrong site. Lastly, I employed your duplicate constraint above as well to make sure they can't double enter a barcode and have it count towards the total acceptable entries for that site. All of these constraints combined seem to have achieved what I was going for.

Thanks for your help and suggestions, Doug! 

One last interesting thing I noticed with the duplicate constraint method: if I hide the text(join) field, the constraint doesn't seem to work. I ended up just putting it in it's own group and minimizing it.