Check out the LimeSurvey source code on GitHub!

Expression Manager and Multiple Token Attributes

More
4 years 15 hours ago - 4 years 15 hours 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: 4 years 15 hours ago by dweisser.

Please Log in to join the conversation.

More
4 years 14 hours 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 ". ;)

Please Log in to join the conversation.

More
4 years 14 hours 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.

Please Log in to join the conversation.

Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form