Welcome to the LimeSurvey Community Forum

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

Copy of the survey> depending on the RADIO field

More
3 years 11 months ago #197557 by Mojon
I am creating a survey of our company's employees.

We have the "employee" field and the option to select 4 defined people as "radio"

I want a copy of the survey to be sent only to the employee's email address after the survey ends.

By default, only two notifications can be received.


Of course, the list of employees and their addresses are available before completing the survey.

How to do it??

LS: 4.1.16+200407
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #197564 by holch
Sorry, somehow your explanation isn't very clear.

Let me get this right: At the beginning of the survey one can select one employee among 4 options (radio - single choice), correct?

Now to which employee's email address do you want to send an email? To the one that is filling the survey or the one that was chosen among the four in the survey?

In any way, this only requires ONE notification option. What you do is you use Expression manager/script in the email field for the admin notification.

Let's say you have those 4 employees that you can choose from in the question Q1 (I assume that this is what you are trying to achieve):

1 Joe Doe
2 John Wayne
3 Billy The Kid
4 Mad Dog

1-4 being the answer codes in the question where you chose the employee and then the names of the employees.

You could write an equation directly into the email field, but I prefer to create a hidden equation question first, it also helps with testing the script.

So create a equation question and let's call it Q1a (don't hide it just yet, you can hide it when you tested everything and it works fine, just before you go into field).

Into this equation I would write something like:
Code:
{if(Q1==1,"joe.doe@yourcompany.com","")}
{if(Q1==2,"john.wayne@yourcompany.com","")}
{if(Q1==3,"billy.kid@yourcompany.com","")}
{if(Q1==4,"mad.dog@yourcompany.com","")}

I haven't tested this code, so it might contain one or the other small error, but I actually think it should work. What it does is checking which employee has been chosen in Q1 and write the email address into the equation field accordingly.

So if everything worked well, this should show joe.doe@yourcompany.com if you chose answer option 1 in Q1.

Then in the field for the admin notification, you can just include something like {Q1a} and it will insert the email address to which the notification is to be sent into the field.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose