I have a choices list that I want to appear as a question if either one of two different choices are selected from a list....I know that I can use a relevant entry of selected(${name}, 'choice') to display it when one choice is selected, but what entry can I enter to have the question displayed if either of these two choices are selected?
Doug,
I'm not clear enough from your question to see the logic you need.
Am I paraphrasing correctly here?:
I made an example of the case described above as an .xlsx form for you to bring into a project.
You can access it here Index of /survey123
Download the Excel workbook, create a "New Survey" in Survey123 Connect, give New Survey a title and use the "Browse.." button to import the workbook and create a Survey123 project.
In this form, the questions of "ear length" and "take a photo of ear" are conditional and only appear if you select the first or third option on the list.
Test if this is the functionality you describe.
Joe
Doug,
In that table notice I made a column called "relevant"
The conditional question will appear base upon the formula in that question's relevant field.
On the condition that one of two choices is true out of a set of four+ choices, then the question appears.
You do this by saying in the formula that if the answer to the prior question equals either "this" or "that" than the relevance of showing this particular question to the user is true.
This requires the use of an OR operator as shown.
selected(${critter},'llama') or selected(${critter}, 'vicuña')
I believe you can also use the AND operator.
Joe
Is it possible to create a Relevant expression based on a Choice Filter? For example, say I have a list of 5 inspector names for the user to choose from. As the user chooses the appropriate name, a choice filter populates a list of projects. Once the user chooses the appropriate project, a relevant expression becomes visible with a yes or no value to choose from indicating whether or not that project has been inspected. It does not matter which project is chosen. I tried using a wild card like an ' * ' in an expression ${PROJECT} = '*' but no luck. I have the first two parts implemented but do not know how to create the relevant expression. Any help would be appreciated!
Jarom.
A Relevant expression is a choice filter.
For your situation you have a form that presents elements that are filtered and "relevant" to the particular inspector.
You have 5 inspectors:
Jarom and Jim inspect plumbing, John does electrical inspection, Joe does termites and Jan checks wheelchair access.
On the choices tab, you would make an inspector list
list_name | name | label | category |
---|---|---|---|
inspectors | Jarom Hlebasko | Jarom | electrical |
inspectors | Jim Jarmusch | Jim | electrical |
inspectors | John Jacobjingleheimerschmitt | John | plumbing |
inspectors | Joe Mamma | Joe | pests |
inspectors | Jan Johnson | Jan | compliance |
On the Survey tab, for every element (or group) relevant to their inspection activity you make a formula that conditionally displays if it is true which simplifies the inspector's form to answer only questions he would observe but distribute one form.
I suggest bundling the questions relevant to them as one group (type=group, use begin_group & end_group to cluster them).
Using the structure below, the group of questions related to those inspectors name.
I only did two groups as an example, but you would have pests and compliance question groups too.
type | name | label | relevant |
---|---|---|---|
select_one inspectors | inspectors | Inspector Name | |
text favoritecolor | color | Favorite color today | |
begin group | electrical | Electrical Inspection | selected(${inpectors},'Jarom Hlebasko') or selected(${inspectors},'Jim Jarmusch') |
integer plugs | plugcount | Number of Plugs | |
text hazardobs | hazard | Hazard Observation | |
image hazardpic | hazardphoto | Photo of Hazard | |
end group | |||
begin group | plumbing | Pluming Inspection | selected(${inpectors},'John Jacobjingleheimerschmitt') |
text pipe | pipetype | Pipe Material | |
decimal diameter | pipewidth | OD of Pipe in decimal inches | |
end group |
I personally would simplify this by having a "select_one inspectiontype" list for picking a type of inspection instead of name>
This allows me flexibility if one of the inspectors may be qualified to do a number of inspection types and this would also help keep the formulas for "relevant" simple if I have 20 or 30 inspectors.
You can add this list in the choices tab like this
list_name | name | label |
---|---|---|
posneg | yes | Yes |
posneg | no | No |
Then make a select_one inspectedyesno option
type | name | label | relevant |
---|---|---|---|
select_one inspectedyesno | inspectstatus | Inspected? |
You can then check off whether one element had been inspected.
Clear as mud?
Joe
If this or other things have been helpful, don't forget to click the "helpful yes no" and or like buttons, it helps sort for other users who have similar questions.
Thanks, I'm going to dive into your instructions right now and will mark it as helpful once I implement what your talking about (hopefully). Thank you for your time!
Jarom,
How did things work out?
Were you able to use relevant in you forms as you wished?
Hope things have been productive.
Cheers,
Joe
Thanks for reaching out Joe! Yes, you gave me some great insight on what I could do to solve the situation that I was in. I appreciate your help and support!