Use a participant's email address domain in a relevance equation

More
4 years 8 months ago #91761 by mgib134
mgib134 created the topic: Use a participant's email address domain in a relevance equation
I'd like to be able to filter questions based off of a participant's email address domain (participants will always have an email address registered in the panel). For example, this survey will be taken by people at two companies, and certain questions will only be displayed to one company or the other.

The current relevance equation I'm using looks like this:
(strstr(TOKEN:EMAIL, '@') == "domain.com")

So, if the participant's email is 'This email address is being protected from spambots. You need JavaScript enabled to view it.' it will compare the string following the '@' symbol. But this doesn't seem to be working. Is this the right way to do this? Is this even possible?

Please Log in to join the conversation.

More
4 years 8 months ago #91764 by tpartner
tpartner replied the topic: Use a participant's email address domain in a relevance equation
strstr() will return a string including the splitting character (needle).

Try:
(strstr(TOKEN:EMAIL, '@') == "@domain.com")

Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now