Using a custom URL feature in Collector to allow users to open an inspection form in Survey123 from the feature needing to be inspected. Configured to have fields come over into text fields in Survey123, that the inspectors must answer. Using the revelant field, can I make those secondary fields dependent on if the primary(linked field) is not null?
Solved! Go to Solution.
Hi. Did you try adding something like string-length(${PrimaryQuestion})>0 into the Relevant column of your secondary question?
Hi. Did you try adding something like string-length(${PrimaryQuestion})>0 into the Relevant column of your secondary question?
See ichivite-esristaff this is why ya'll are the best and so very helpful. I looked on XLSForm.org and other help docs. That worked. Thanks as always.
I'm having a similar problem, but with numbers rather than a string. I want to test to see if the user has missed field. This is different to it being a required field as the user will have the option to acknowledge that it is a valid NULL value.
JTedrick-esristaff provided me some great advice on how to do the acknowledge, but the NULL test side of it has really got me chasing my tail!
Hi Dan, I replied in the original thread - the information on empty values is at Formulas—Survey123 for ArcGIS | ArcGIS - the string-length function also provides the null check for numerics.
Can you supply an example of the syntax for 'NaN' within a constraint? I'm struggling to get it right. As you indicate above it's part of the string-length function. The documentation also states that "The NaN value compared to any other value will only be true in a calculation of an "is not equal" value comparison. All other expressions will result in false." As such, I came up with the below but it fails to trigger the constraint if {QUANTITY1} is left blank:
if(selected(${MATERIALS_USED}, 'YES'), string-length(${QUANTITY1})!=NaN, true())
Thanks
Hi Andrew,
The check for string-length is to compare it to 0 - the string-length function will return 0 for null or NaN values.
string-length(${QUANTITY1}) > 0
is true for non-NaN or null values, false otherwise.
The discussion on NaN/null you cite concerns understanding how those values affect calculations in other questions, not how to test for NaN/null.
Hmmm...struggling to wrap my head around this one. If I understand what you're saying:
if(selected(${MATERIALS_USED}, 'YES'), string-length(${QUANTITY1})!=0, true())
I've asked this in a similar thread here.
Thanks