TL;DR I use a pulldata("@layer","getRecordAt",...) calculation to query attributes of a feature at a given geopoint. This calculation should only occur when triggered by another question (Question A). To achieve this, I use the "Relevant" column to make the question only relevant once Question A has been answered. However, the pulldata() calculation will trigger prematurely when the geopoint question is answered (since the geopoint in referenced as an input in the pulldata() calculation), ignoring the "Relevant" criteria and causing the app to hang.
Hello, I have a survey that follows roughly the following workflow:
- Travel to a field
- Drop a geopoint in that field to set a location
- Use that geopoint to query an online map layer for information about that location
- Record additional details about that location (pictures, ect)
- Submit the survey
If the user has cell signal, then the pulldata() calc works great. If they are offline, then the pulldata() calc never gets to try, and the user enters the info manually, which also works great. However, my users work in remote areas where they have weak cell signal. The key here is weak, and not none. If the signal is weak, then the pulldata() calc tries to pull the data over the weak signal and the entire survey becomes unresponsive and freezes/hangs for several minutes. The user can't even exit the survey, they are just stuck.
To try and elegantly handle these three scenarios, I implemented a text question with a "calculationMode=manual" qualifier that requires the user to trigger the calculation process to start. Once the button is pressed, it begins by querying the geopoint location for a specific attribute (a unique ID), which once obtained triggers a separate calculate question with that unique ID passed to it in order to pulldata("@layer","getRecordAt") the appropriate record so it can be referenced internally with the "@json" function. This second calc is restricted by a condition in the "Is Relevant" to only run once the unique ID is present in the first quesion.
The problem occurs when the geopoint question gets involved. I utilize the "press-to-locate" appearance for our geopoint question. So when the survey is first opened, no geopoint exists and the app works as expected. But when the user presses to aquire their GPS location, it appears that the calculate question (the pulldata("@layer","getRecordAt",...) calc) gets triggered despite the conditions in the "Relevant" column not being satisfied. This results in the app hang.
I've tried so many fixes to get this question to NOT trigger. I've tried changing question types, explicitly specifying "calculationMode=auto", adding if() statements in the calc to only calculate if other conditions are met, but the darn thing still triggers EVERY TIME the geopoint question changes. I'm at the end of the line here, I can't seem to find any solution to prevent this calculation from triggering. I've included a screenshot of the problematic line below (scrubbed for company info).

Any suggestions?