Welcome to the LimeSurvey Community Forum

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

Show question if some specifics words are found on a previous text answer.

  • Oterito
  • Oterito's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
6 months 3 weeks ago #267688 by Oterito
Please help us help you and fill where relevant:
LimeSurvey version: 6.6.7
Own server or LimeSurvey Cloud: LimeSurvey Cloud
Survey theme/template: Vanilla
==================
Hi! Is there any equation o something that can use for found specific text on a text question answer? 
I have a text question which ask some reasons for consume some products, and I would like to show a second question if they mention some specific words on the first question, for example if some write "healthy" or "health" etc. 

Thank you in advance

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 3 weeks ago #267691 by Joffm
You may use something like
strpos(Q1,"health")>0 or strpos(Q1,"elefant")>0 or...

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
6 months 3 weeks ago #267700 by DenisChenu
I use

strpos("#"+Q1,"health")>0 or strpos("#"+Q1,"elefant")>0 or...

Then it work if it's the first word.

And to avoid warning
strpos(join("#",Q1),"health")>0 or strpos(join("#",Q1),"elefant")>0 or...

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
6 months 3 weeks ago #267703 by Joffm
@Denis,
you are right.
Furthermore you should compare only uppercase to avoid "health", "Health", ...
My example was only the first rough idea.
strpos(join("#",uppercase(Q1)),"HEALTH")>0 or strpos(join("#",uppercase(Q1),"ELEFANT")>0

And you have to do some more fine tuning.

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: jonas.jau

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose