Welcome, Guest
Username: Password: Remember me

TOPIC: Array_filter vs. Expression Manager vs. passing through "other"

Array_filter vs. Expression Manager vs. passing through "other" 1 year 3 months ago #99295

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2955
  • Thank you received: 379
  • Karma: 124
I have 2 question, that depend on each other.

First question is the brands they know (multiple answers possible), the second asks about the brands they use the most (single answer)

So far so good, this is a case for array_filter (which by the way took quite a while to find, because it is in a totally different position in the Eortuguese version as in the English version!!!).

OK. so I set up my questions and this works fine, but I have one problem: There is a "other" option.

And I would like to pass on the answer to the other option, if chosen, to the second questions. So I used Expression Manager to pass on the answer to "other" in my question S9 via
{S9_other}
to my question S9a.

However, my problem now is that there is always a radio button, because the array_filter doesn't recognize the other option from the S9 (because it wasn't there).

So I am no wondering how I can do that. One idea was that I could avoid built in "other" option in S9 and instead create another open question that opens only when a answer item called "other" (different from the standard "other" option from LS) and then pass through the response of that to the next question.

But I think there must be a solution for the built in "other" option well. Any ideas?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Array_filter vs. Expression Manager vs. passing through "other" 1 year 3 months ago #99296

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2955
  • Thank you received: 379
  • Karma: 124
Here to show what I mean. As nothing is chosen yet in S9, there should be no radio button in S9a.

But as the piped in option from S9_other didn't exist in the first option as a normal answer option, the radio button appears, because the array_filter doesn't manage to catch it of course.

h0ec96b7.png
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Array_filter vs. Expression Manager vs. passing through "other" 1 year 2 months ago #99310

  • trivender
  • trivender's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 146
  • Thank you received: 7
  • Karma: 7
I have a quick solution if you are comfortable in displaying both questions on separate screens.
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
The administrator has disabled public write access.

Array_filter vs. Expression Manager vs. passing through "other" 1 year 2 months ago #99336

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2955
  • Thank you received: 379
  • Karma: 124
Hi Trivender. In general the questions can be shown on different screens. I would have to restructure the whole survey a little, but...
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Array_filter vs. Expression Manager vs. passing through "other" 1 year 2 months ago #99344

  • trivender
  • trivender's Avatar
  • OFFLINE
  • Expert Lime
  • Posts: 146
  • Thank you received: 7
  • Karma: 7
Good news :), You don't have to restructure the whole survey. After spending some time I found that we can do it on the same page as well. Just use "other" as answer code.Dummy Screen shot is attached.You will see a radio button for "other specify " only when you will enter something in the text box. Enjoy.
Attachments:
Trivender Singh
Survey Designer and Programmer
"I always suggest to have a group by group display layout and create a seprate group for each question. This will be extra work but you will get flexiblity to create your question by using more than more lime survey question types."
Last Edit: 1 year 2 months ago by trivender.
The administrator has disabled public write access.
The following user(s) said Thank You: holch

Array_filter vs. Expression Manager vs. passing through "other" 1 year 2 months ago #99355

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 869
  • Karma: 257
Hi,

Maybe it can be great to put this in our workaround wiki :)
The administrator has disabled public write access.

Array_filter vs. Expression Manager vs. passing through "other" 1 year 2 months ago #99384

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2955
  • Thank you received: 379
  • Karma: 124
Hey, nice! I will give it a try later on today and see if it works.

This would be great.

I just saw that you used .NOAK, I usually use .SHOWN. Is there any difference?
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Array_filter vs. Expression Manager vs. passing through "other" 1 year 2 months ago #99390

  • holch
  • holch's Avatar
  • NOW ONLINE
  • LimeSurvey Team
  • Posts: 2955
  • Thank you received: 379
  • Karma: 124
Just a quick feedback: works like a charm. However, please remember that "other" must be written with a small "o" at the beginning. I had "Other" first and it didn't work. I was a little disappointed that it didn't work, but then double checked and found my mistake.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
The administrator has disabled public write access.

Array_filter vs. Expression Manager vs. passing through "other" 1 year 2 months ago #99399

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6551
  • Thank you received: 869
  • Karma: 257
holch wrote:
I just saw that you used .NOAK, I usually use .SHOWN. Is there any difference?
NAOK give code, SHOWN the sentence showed to user.
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.169 seconds
Donation Image