Welcome to the LimeSurvey Community Forum

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

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

  • mgib134
  • mgib134's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
11 years 1 month 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:
Code:
(strstr(TOKEN:EMAIL, '@') == "domain.com")

So, if the participant's email is 'name@domain.com' 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?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
11 years 1 month ago #91764 by tpartner
strstr() will return a string including the splitting character (needle).

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

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose