Relevant if a specific option in a select multiple question has been selected

Hi,

I was wondering if anyone knows how to specify a relevant clause when you
want that question asked only if a specific option is selected from a
checkbox question?

  • if question a has options with values 1,2,3, 99
  • Then I'd like question b to be relevant if the user selects 99 so
  • option 1 and option 99
    • options, 2,3 and 99
  • But not if they just select 2 and 3

Any hints gratefully received.

Regards

Neil

Neil,
You use the 'selected' attribute, like this:

this questions shows when question 1 (a Multi) has the option '99' selected.
It will show if any combination of options that include '99'

relevant="selected(/data/q1, '99')"

You can combine that with 'and' to require that more than one multi option
is selected.

relevant="selected(/data/q1, '99') and selected(/data/q1, '2')"

โ˜žยงโ€ปโ˜ผ:airplane::open_umbrella::slight_smile:
~Neil

ยทยทยท On Tue, May 3, 2011 at 10:39 AM, Neil Penman wrote:

Hi,

I was wondering if anyone knows how to specify a relevant clause when you
want that question asked only if a specific option is selected from a
checkbox question?

  • if question a has options with values 1,2,3, 99
  • Then I'd like question b to be relevant if the user selects 99 so
  • option 1 and option 99
    • options, 2,3 and 99
  • But not if they just select 2 and 3

Any hints gratefully received.

Regards

Neil

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

1 Like

Thanks Neil,

Works perfectly.

Regards

Neil

ยทยทยท On Tue, May 3, 2011 at 10:04 PM, Neil Hendrick wrote:

Neil,
You use the 'selected' attribute, like this:

this questions shows when question 1 (a Multi) has the option '99'
selected. It will show if any combination of options that include '99'

relevant="selected(/data/q1, '99')"

You can combine that with 'and' to require that more than one multi option
is selected.

relevant="selected(/data/q1, '99') and selected(/data/q1, '2')"

โ˜žยงโ€ปโ˜ผ:airplane::open_umbrella::slight_smile:
~Neil

On Tue, May 3, 2011 at 10:39 AM, Neil Penman neilpenman@gmail.com wrote:

Hi,

I was wondering if anyone knows how to specify a relevant clause when you
want that question asked only if a specific option is selected from a
checkbox question?

  • if question a has options with values 1,2,3, 99
  • Then I'd like question b to be relevant if the user selects 99 so
  • option 1 and option 99
    • options, 2,3 and 99
  • But not if they just select 2 and 3

Any hints gratefully received.

Regards

Neil

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

--
Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en

i have tried this suggestion as i have a similar task to accomplish but the
specify for me is showing even when the 99 is not selected i am not sure
where i not implementing right .
i have used this relevant for the specify question
"selected(/screening_form/source, '99')"
any help please

Five years after and this is still valid.. Thanks

ยทยทยท On Tuesday, 3 May 2011 15:39:12 UTC+1, Neil Penman wrote: > Hi, > > I was wondering if anyone knows how to specify a relevant clause when you want that question asked only if a specific option is selected from a checkbox question? > if question a has options with values 1,2,3, 99 > Then I'd like question b to be relevant if the user selects 99 so > option 1 and option 99options, 2,3 and 99But not if they just select 2 and 3Any hints gratefully received. > > > Regards > > Neil

Hi Mukanya,
Are you using XLSForm or creating the XForm directly?
If you could attach the XLSForm or XForm you are using that would help us
find the issue.
Regards,
-Nathan

ยทยทยท On Tuesday, July 10, 2012 12:40:35 AM UTC-7, Mukanya wrote: > > i have tried this suggestion as i have a similar task to accomplish but > the specify for me is showing even when the 99 is not selected i am not > sure where i not implementing right . > i have used this relevant for the specify question > "selected(/screening_form/source, '99')" > any help please >
1 Like

Use something like this: selected(${my_multi_choice_question}, 'option_1')

Yaw

ยทยทยท -- Need ODK consultants? Nafundi provides form design, server setup, in-field training, and software development for ODK. Go to https://nafundi.com to get started.

On Mon, Aug 1, 2016 at 9:36 AM, abumere.ejakhegbe@gmail.com wrote:

Five years after and this is still valid.. Thanks

On Tuesday, 3 May 2011 15:39:12 UTC+1, Neil Penman wrote:

Hi,

I was wondering if anyone knows how to specify a relevant clause when you want that question asked only if a specific option is selected from a checkbox question?
if question a has options with values 1,2,3, 99
Then I'd like question b to be relevant if the user selects 99 so
option 1 and option 99options, 2,3 and 99But not if they just select 2 and 3Any hints gratefully received.

Regards

Neil

--

Post: opendatakit@googlegroups.com
Unsubscribe: opendatakit+unsubscribe@googlegroups.com
Options: http://groups.google.com/group/opendatakit?hl=en


You received this message because you are subscribed to the Google Groups "ODK Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to opendatakit+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

2 Likes

Hi Nathan

I attach the file so i only want the specify question to appear if other is
selected alone or is part of the selection list .I hope this is clear enough

test.xls (33 KB)

1 Like

In XLSForms the relevant formulas work a little differently. You do not
need to enter an XPath, you can enter ${question_name} instead. Also, you
shouldn't use quotes. So try this formula:
selected(${item_owned}, '99')
Hope this helps,
-Nathan

ยทยทยท On Tuesday, July 10, 2012 11:01:47 AM UTC-7, Mukanya wrote: > > Hi Nathan > > I attach the file so i only want the specify question to appear if other > is selected alone or is part of the selection list .I hope this is clear > enough >
1 Like

Hi Nathan

That was sport on thank you my man its all sorted now

1 Like