Check out the LimeSurvey source code on GitHub!

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

More
4 years 4 weeks ago #91761 by mgib134
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 4 weeks ago #91764 by tpartner
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.

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