Hi! I've got a working report template, but I have some text responses that I only want to appear when relevant. My issue is the input is a number and so when it's empty, the report still evaluates it as a zero, but zero is also a valid input and I need a different message for a null/empty field vs >=0.
${if NitrateResult == "" || NitrateResult == null} evaluates as true in the report even if the user actually entered in zero. And the reverse, if the field is empty: ${if NitrateResult >=0 && NitrateResult <0.5} evaluates as true even though the user didn't enter in 0.
I'm wondering how to tackle this so both messages don't appear when the field is empty or zero which is what is happening now:
${if NitrateResult == "" || NitrateResult == null}Not Reported ${/}${if NitrateResult >=0 && NitrateResult <0.5}Your nitrate results were under detection. This means that your water is below the Health Risk Limit of 10 mg/L (milligrams per liter) for nitrate. ${/}
I've tried ${if NitrateResult != "" && NitrateResult != null && NitrateResult >=0 && NitrateResult <0.5}, but Survey123 just errors and fails to fetch the report:
${if NitrateResult == "" || NitrateResult == null}Not Reported ${/}${if NitrateResult != "" && NitrateResult != null && NitrateResult >=0 && NitrateResult <0.5}Your nitrate results were under detection. This means that your water is below the Health Risk Limit of 10 mg/L (milligrams per liter) for nitrate. ${/}
This prevents both messages from appearing when the user enters 0 or nothing, but the second message doesn't appear when the user enters zero, which is what I'm after:
${if NitrateResult == "" || NitrateResult == null}Not Reported ${/}${if NitrateResult >0 && NitrateResult <0.5}Your nitrate results were under detection. This means that your water is below the Health Risk Limit of 10 mg/L (milligrams per liter) for nitrate. ${/}