Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:

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

Use a participant's email address domain in a relevance equation 3 years 10 months ago #91761

  • mgib134
  • mgib134's Avatar
  • Offline
  • Fresh Lemon
  • Posts: 10
  • Karma: 0
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?
The administrator has disabled public write access.

Use a participant's email address domain in a relevance equation 3 years 10 months ago #91764

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Team
  • Posts: 6566
  • Thank you received: 1477
  • Karma: 578
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.
The administrator has disabled public write access.
Time to create page: 0.566 seconds
Imprint                   Privacy policy         General Terms & Conditions         Revocation information and revocation form