Is it possible to populate a question using information filled in on another question, dependent on the answer to another question?
I'm trying to modify the Damage Assessment Survey that comes in the Damage Assessment Solution to better suit my municipalities needs. We have a select one question asking if the point of contact is the property owner, an occupant, or both owner and occupant of the property. Then there's a set of questions asking point of contact's information, and another section asking owner information. What I'd like to do, is if "Owner" or "Owner/Occupant" is selected, to have the point of contact information populate into the owner information.
I tried using this expression in the calculate section:
if(selected(${represent}, 'Owner'), ${contactname}, '')
where ${represent} is the select one question described above, and the '' at the end is two single quotes to prompt leaving the question blank
I've tried the above expression, and it didn't work. I've tried the above expression with words in the final single quotes, and it worked fine UNLESS I selected "Owner". I've tried the expression with ${contactname} in single quotes, which returned a file path.
Is it possible? Am i using the wrong expression, or missing something in syntax?
Solved! Go to Solution.
Hi @JenAmes
You can use this expression instead of the one you have used:
if(selected(${represent},'Owner') or selected(${represent},'Owner/Occupant'),${contactname},'')
Hope this works,
Wali
Hello @JenAmes,
If possible would you be able to provide a copy of your XLSForm for testing on our end? I've tested with a simple survey and the calculation is working correctly.
Hi @JenAmes
You can use this expression instead of the one you have used:
if(selected(${represent},'Owner') or selected(${represent},'Owner/Occupant'),${contactname},'')
Hope this works,
Wali
I swear I used the exact same syntax previously and it didn't work. But it did this time, so that's all that matters. Thanks for your help!