I’m new to the platform and really excited to learn more.
I’m encountering a little problem whenever I try to use my case values in my followup form. My questionnaire needs to check previously entered case data and use them in simple arithmetic calculations (all integers). However, if these case values are blank (i.e. they did not collect data due to logical skips in the form observed during the last previous followup survey visit), then instead of using zeros in the calculations (as I would expect since the case values hold no data), my followup form strangely seems to instead use the case values from even further back, (specifically in my case, from the immediately prior followup case data before the intended one that holds actual collected data and not blanks (the logical skip pattern in that case enabled data to be collected in the case values). So I’m left with wrong results.
Could anyone explain to me why this is happening and how I can resolve this?
that sounds interesting
can you share the expressions that are carrying the calculations?
if you’re looking at case data, perhaps it’s pulling from the wrong case?
@Mazz Thanks for the speedy response!
I’ve attached a screen grab of the expression as it appears on the editor. Please see below:
You mention that it may be pulling from the wrong case. Is this possible? How could that happen?
I think I can clarify what’s happening in your app.
When a Display Condition results in a question not being asked to a user, any Case Property updates which are configured for those questions are not processed. So instead of those questions setting the case properties to ‘0’, or blank, they simply aren’t changed.
If you want the alternative behavior, the way to configure that would be to configure a Hidden Value question which doesn’t have a display condition, but whose calculation is set to the value of the question which does. Since this Hidden Value question is never removed from the form with a Display Condition, it will set the Case Property to the appropriate value.
This is a nuanced little thing that i’m not sure i read anywhere else in documentation.
really glad i found out about this
Thank so much for your valuable insight into this. I did as you had advised and this fixed the problem form me. Much appreciated.
@Mazz Thanks again for all your input.