Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

Hide (exclude) an answer option if array field is empty - How?

  • mbates
  • mbates's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #186057 by mbates
I have a ranking question with answer options that are populated from an array(texts) based on prior questions. For example, the answer options are:
{AR_Y001_X001}
{AR_Y001_X002}
{AR_Y001_X003}

There are circumstances where one of these array fields could be empty. What is the best way to hide an answer option if the field is empty? Otherwise, I am stuck with showing a blank answer option.

Thanks in advance for any advice.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 9 months ago #186058 by Joffm
Hi, mbates,
in scenarios like this I like to include a hidden question of type "multiple choice".
Here I check according to the answers in the array ("Y" = filled, "" = empty) by an equation.
Now I use this hidden question as array filter for my ranking question.

Because there are used only built-in features it is easy to understand, easy to implement and extendable without knowledge of anything else than LS basics.
To be honest: That is what I know, LS basics. ;)





and an example

File Attachment:

File Name: limesurvey...8277.lss
File Size:24 KB


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: mbates
The topic has been locked.
  • mbates
  • mbates's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 9 months ago #186079 by mbates
Perfect! Worked perfectly. Thank you, Sir.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose