Relevant field checking if previous question has been answered

3558
5
08-29-2016 09:06 AM
AndyKeljarrett
New Contributor III

Hello,

Just wanted to check if anyone knew how to make a question / section only appear once a question has been filled in? In this instance I don't mind what answer has been put in, only that an answer HAS been put in. I had managed to do this but have since accidentally deleted the relevant XLSForm

Thanks

Andy

Tags (2)
5 Replies
IsmaelChivite
Esri Notable Contributor

Did you try ${PreviousQuestion} !='' in the Relevant column?

AndyKeljarrett
New Contributor III

Works brilliant for text etc questions. What if I want to check if a Geopoint question type has been filled in?

SeanEdwards
New Contributor II

Ismael, I'm wondering if this relevant works with dates. I am calculating "Days on Assignment" by subtracting ${Date2} - ${Date1} with ${Date1} a required field but not ${Date2}.

I have figured out the calculation but cannot figure out how to hide ${DaysOn} unless ${Date2} is selected.

Date1 and Date2 are type date and DaysOn is an integer.

Cheers!

IsmaelChivite
Esri Notable Contributor

The safest way to figure  if a question is empty is to use string-length. For example: string-length(${Date2})>0 in your relevant column for DaysOn will hide DaysOn unless Date2 has been answered.  string-length works well with all types  of  XLSForm questions.

SeanEdwards
New Contributor II

Thank you Ismael, that worked perfectly. 

0 Kudos