Enabling some questions based on the options selected on a multi choice question

Dear team

I have a multi choice variable where the options are own account worker, regularly paid and casual worker. I have created a roster using this multi choice variable where by if the person select regularly paid worker a set of questions should come. My question is how can I filter some questions according to the options they select in the multi choice questions. For example if they select own account worker questions on payment should not be enabled but it should be enabled for regularly paid worker. i tried containsAny, containsAll but not working.

Thank you

Most likely the problem is with spelling. All of the “Contains*” functions should be spelled with a capital C: Contains, ContainsAny, ContainsAll. For example :
varname.Contains(101)

But from the type of question it should be a single select, (one is either a causal worker or regularly paid, but probably not both). So in that case a condition may be just:
varname==101

Best, Sergiy

Dear Sergiy

No it was Capital “C”. And the Establishment can have more than One type of workers. There was no error but the condition ContainsAny or ContainsAll didn’t work.

If the question is in Yes/No mode than you need to prepend the function with the appropriate array name, either Yes, or No, or Missing, or All.
varname.Yes.ContainsAny(101,102,105)

For syntax errors, show

  1. the exact expression as appears in your questionnaire
  2. the exact message that survey solutions produced
  3. all macros used, and all questions declarations that were used in your expression.

Sergiy

1 Like

Daer Sirgeiy

My issue is: With survey Solution multi choice questions if I use containsAny then if any of the choices in the coontainsAny bracket gets selected then the questions are displayed even for the choice that I do not wanted it to be displayed. For ex: using the above same example: if I select own account worker and casual paid worker since casual paid is selected the questions on payment which should not be displayed for own account worker is also displayed. Is there a way to hide the questions on payment when own account worker is selected but display it for other choices like causal paid if even if the establishment has both own account and casual .

Tshering, in the conditions of the questions inside the roster you can refer to @rowcode to behave differently for different roster items. For example, if your worker type question is
101 own account
102 regular paid
103 casual paid
then within the roster (triggered by this mcq) you can put a condition on the question of e.g. contract type
@rowcode!=101
to make it applicable to any of the above except own account workers (code 101).

@rowcode is described here:
https://support.mysurvey.solutions/syntax-guide/cslanguage/syntax-guide-system-generated-variables/

Best, Sergiy

2 Likes

Great!!! working now
Thank you so much