Welcome to the LimeSurvey Community Forum

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

Expression Manager and Multiple Token Attributes

  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
11 years 1 month ago - 11 years 1 month ago #91535 by dweisser
Apologies if this is in the forum somewhere already.

I'm trying to concatenate two strings in this expression:

Welcome to {if(TOKEN:ATTRIBUTE_4=='Self', 'your Self',join(',',TOKEN:ATTRIBUTE_1,TOKEN:ATTRIBUTE_2))} assessment.

The "join()" segment is getting an unsupported syntax warning. Just to see, I've tried:

Welcome to if(TOKEN:ATTRIBUTE_4 == 'Self', 'your Self', TOKEN:ATTRIBUTE_1 TOKEN:ATTRIBUTE_2)) assessment.

And it blows up as well. Any ideas?

David
Last edit: 11 years 1 month ago by dweisser.
The topic has been locked.
  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
11 years 1 month ago #91545 by dweisser
Found the solution,

Hello, Welcome to if(TOKEN:ATTRIBUTE_4 == 'Self', 'your Self', TOKEN:ATTRIBUTE_1 + ' ' + TOKEN:ATTRIBUTE_2 + 's') assessment.

You have to use "+" to join the strings. Now, I have to figure out how to concatenate the " 's ". ;)
The topic has been locked.
  • dweisser
  • dweisser's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
11 years 1 month ago #91548 by dweisser
And appending the *apostrophe s* ala *'s* was simple.
Just use double quote in the equation.

Welcome to if(TOKEN:ATTRIBUTE_4 == 'Self', 'your Self', TOKEN:ATTRIBUTE_1 + ' ' + TOKEN:ATTRIBUTE_2 + "'s") assessment.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose