- Posts: 10
- Thank you received: 1
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Using insertans within if commands
- joebloggs1987
- Topic Author
- Offline
- New Member
Less
More
6 years 8 months ago #157650
by joebloggs1987
Using insertans within if commands was created by joebloggs1987
I am just wondering how to display an answer by using an if command.
E.g....
if(a == 1, "insertans", "")
Is there a way of doing this in Limesurvey?
Thanks.
E.g....
if(a == 1, "insertans", "")
Is there a way of doing this in Limesurvey?
Thanks.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12937
- Thank you received: 3979
6 years 8 months ago - 6 years 8 months ago #157652
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic Using insertans within if commands
Of course:
Without knowing exactly, what "a==1" is, well, just any comparison.
Something like: {if(a==1,Q01_SQ001.NAOK,"alternative text")}
Joffm
Without knowing exactly, what "a==1" is, well, just any comparison.
Something like: {if(a==1,Q01_SQ001.NAOK,"alternative text")}
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 6 years 8 months ago by Joffm.
The following user(s) said Thank You: mandroul
The topic has been locked.
- mandroul
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
4 years 9 months ago #186139
by mandroul
Replied by mandroul on topic Using insertans within if commands
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
4 years 9 months ago #186156
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Using insertans within if commands
The issue is in the Question Q4 itself. The variable Q4 contains more data than needed.
What is Q4. If it is a Equation question it might contain HTML code somewhere, which pollutes the variable Q4.
What is Q4. If it is a Equation question it might contain HTML code somewhere, which pollutes the variable Q4.
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10109
- Thank you received: 3595
4 years 9 months ago - 4 years 9 months ago #186159
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic Using insertans within if commands
Your IF statement is incomplete. You need to include both the result if true and the result if untrue.
Code:
{if(Q4.NAOK == 'A1', 'Result if true', 'Result if untrue')}
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 4 years 9 months ago by tpartner.
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13648
- Thank you received: 2491
4 years 9 months ago #186162
by DenisChenu
github.com/LimeSurvey/LimeSurvey/commit/...9b8a12bc55cd33b46a1e
Else : i think there are a bad copy/paste of code looking at www.limesurvey.org/media/kunena/attachments/195537/Capture.PNG screenshot.
I my opinion : you must check HTML source of question
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
Replied by DenisChenu on topic Using insertans within if commands
Not since 3.0.2tpartner wrote: Your IF statement is incomplete. You need to include both the result if true and the result if untrue.
github.com/LimeSurvey/LimeSurvey/commit/...9b8a12bc55cd33b46a1e
Else : i think there are a bad copy/paste of code looking at www.limesurvey.org/media/kunena/attachments/195537/Capture.PNG screenshot.
I my opinion : you must check HTML source of question
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
- mandroul
- Offline
- New Member
Less
More
- Posts: 2
- Thank you received: 0
4 years 9 months ago - 4 years 9 months ago #186209
by mandroul
Replied by mandroul on topic Using insertans within if commands
Thank you all, you've been very helpful.
I can confirm that the field of the untrue case does not need to be completed if not necessary.
Issue resolved after checking the HTML source.
It seems that somehow some options/tags were added on the background in the HTML source after pasting from word and changing fonts. Just removing the extra added options/tags resolved the issue.
Couldn't reproduce the issue for potentially filling a bug report.
I can confirm that the field of the untrue case does not need to be completed if not necessary.
Issue resolved after checking the HTML source.
It seems that somehow some options/tags were added on the background in the HTML source after pasting from word and changing fonts. Just removing the extra added options/tags resolved the issue.
Couldn't reproduce the issue for potentially filling a bug report.
Last edit: 4 years 9 months ago by mandroul.
The topic has been locked.