Change to hidden calculation behavior in repeats - field app version 3.14.237

462
1
03-03-2022 01:06 PM
ErikHerbergMETC
New Contributor III

I've noticed a change in how my forms behave in the update to field app version 3.14 from 3.13. My forms utilize hidden calculations to populate extra metadata within repeats. In some situations, they are triggered by checking to see if a decimal field was filled in using string-length(). This has worked well for over a year on 3.13 and earlier field app versions, but in 3.14 it doesn't always work. I'm curious if there is a way to still get the same results with the changes applied in 3.14, or if maybe this is a new bug. 

Specifically, I noticed that if I have a hidden calculation in a repeat that is triggered by checking for a string-length > 0 of a previous decimal field, it correctly fires in the background if the form is submitted from that repeat, or if you hit enter after entering the text or decimal, or you click into another field box (but not by answering select one or multiples). However, the hidden calculation doesn't trigger if you fill in the decimal field, and then add another repeat. Basically, the entry isn't "recognized" when the repeat is added, so the hidden calculation doesn't trigger.

I created a simplified XLS form to replicate this. There is a hidden field called "air_temp_classification". It has a calculation triggered whenever the decimal air_temp field has a string-length > 0, aka when anything is entered. On field app version 3.14.237, this hidden calculation won't trigger if you select "Field Observation" type in an "Air Temperature", immediately add a second repeat (don't fill in "Notes"), and then submit. In the previous version of the app I have access to, 13.246, this calculation would fire. So it's almost like in version 3.13, adding a repeat "validated" the text/decmial entry so these hidden calculations could trigger, but in 3.14 that no longer happens when adding a repeat. 

I also tried a calculation question type with a hidden appearance, and it's the same behavior is 3.14.237.

That's for any help or insight!

1 Reply
ErikHerbergMETC
New Contributor III

I may have found my own simple solution - setting the decimal field to an appearance of "numbers" appears to do the trick. Seems like the number pad forces the equivalent of hitting return, either by clicking the blue return arrow on the number pad or by clicking out of the number pad. Both actions seems to trigger the hidden calculation now. Obviously this wouldn't work on text fields, but luckily I don't have any hidden calculations based on any entry to a free text field. 

Still, if anyone has a "better" solution, please let me know!