Copy of the survey> depending on the RADIO field

More
2 months 2 weeks 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

Please Log in to join the conversation.

LimeSurvey Partners
More
2 months 2 weeks 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:
{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 This email address is being protected from spambots. You need JavaScript enabled to view it. 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.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now