Welcome to the LimeSurvey Community Forum

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

Can I use custom token attributes in relivance equations?

More
8 years 7 months ago #144165 by Qsgt
Hi,

I have a survey with tokens enabled with multiple custom attributes. I have one custom attribute that is either blank or will contain Yes. I would like to be able to use relevance equations to display or hide questions based on whether the attribute is Yes or not but I can't seem to make it work. I have tried the equation
Code:
TOKEN:ATTRIBUTE_6=='Yes'
and it has had no effect. I have also tried
Code:
!is_empty(TOKEN:ATTRIBUTE_6)
but still nothing. I then thought I could set TOKEN:ATTRIBUTE_6 as the default answer to a hidden question called status and writing the relevance equation
Code:
!is_empty(status)
and it still did not work. Any ideas as to what I am doing wrong or if what I want to do is possible.

Thanks in advance,
qsgt
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago - 8 years 7 months ago #144167 by holch
The first code should work (in my opinion - not tested). What did you do with this code? Where did you put it?

Help us to help you!
  • Provide your LS version and where it is installed (own server, uni/employer, SaaS hosting, etc.).
  • Always provide a LSS file (not LSQ or LSG).
Note: I answer at this forum in my spare time, I'm not a LimeSurvey GmbH employee.
Last edit: 8 years 7 months ago by holch.
The topic has been locked.
More
8 years 7 months ago #144230 by Qsgt
Very strange because the first code is not working for me.

I have included a screenshot below of how I have used it in my questions. Does it look like I'm doing it right?

The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 7 months ago - 8 years 7 months ago #144247 by tpartner
Could it be a text case issue?

Try:
Code:
strtolower(TOKEN:ATTRIBUTE_6) == 'yes'

Or:
Code:
TOKEN:ATTRIBUTE_6 != ''

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 8 years 7 months ago by tpartner.
The topic has been locked.
More
8 years 6 months ago #144283 by Qsgt
That seems to have fixed it.

Thanks a lot,
qsgt
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose