Welcome to the LimeSurvey Community Forum

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

Inserting an Q.Value into confirm email conditionally

  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 9 months ago #202522 by marcgold
Hi

Wondering if this is even possible, we have a conditional if statement within the confirmation email, but want to add in some data from the survey is this even possible and if so, how.

The following doesn't work. I have tried wrapping the variables in @@****@@ but that doesnt work either.

This is what we have - which doesn't work.
Code:
{if (Q15 == "A6","We will process your gratuity of £50 within the next few days to the account details you have provided","Thank you for thinking of the {Q15.Value} we will make the donation of {Q32.Value} on your behalf.  Any balance remaining will be paid to you via BACS within the next 7 days")}


Any help appreciated
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 9 months ago - 3 years 9 months ago #202537 by tpartner
You cannot put curly braces inside an Expression Manager statement that is already wrapped in curly braces.

You insert a variable into a text string as you would in JavaScript.

Try this:

Code:
{if (Q15 == "A6","We will process your gratuity of £50 within the next few days to the account details you have provided","Thank you for thinking of the "+Q15.value+" we will make the donation of "+Q32.value+" on your behalf.  Any balance remaining will be paid to you via BACS within the next 7 days")}

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 3 years 9 months ago by tpartner.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • marcgold
  • marcgold's Avatar Topic Author
  • Offline
  • Premium Member
  • Premium Member
More
3 years 9 months ago #202549 by marcgold
Your a star! As always.
That worked perfectly.

Thanks
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose