Welcome to the LimeSurvey Community Forum

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

Piping is not working in question text

  • DanielVN
  • DanielVN's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
4 years 2 months ago #193450 by DanielVN
Piping is not working in question text was created by DanielVN
Hi team,

I'm currently scripting a survey where I need to ask two numeric question Q037 and Q038.

The first question (Q037) is asking what is the highest acceptable price that someone would pay for a coffee machine.

The second question (Q038) is asking what is the lowest price.

I have scripted the questions and I have applied a Question validation equation: sum(self.NAOK) < sum(that.Q037.NAOK) to question (Q038) to make sure that in the second question the respondent would not enter answer higher than the one in the first question.

In addition I have added in the question text the following expression:

{if(sum(self.NAOK) > sum(that.Q037.NAOK),"Please correct your answer. Your answer should not exceed {Q037}.","")}

The issue is that no matter what I have tried the value from question Q037 is not shown (marked in Orange). I believe that this is due to the fact that {} are used twice.

Could you please advise how to proceed in order to show the value from question Q037 in the question text?

P.S. I'm using Limesurvey v. 2.73
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Online
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 2 months ago - 4 years 2 months ago #193452 by Joffm
Replied by Joffm on topic Piping is not working in question text

I believe that this is due to the fact that {} are used twice.

You are right.
You should do it like this.
{if(sum(self.NAOK) > sum(that.Q037.NAOK),"Please correct your answer. Your answer should not exceed "+Q037+".","")}

But a better way would be to set the maximum value of Q038 to Q037 (Advanced settings).
manual.limesurvey.org/Question_type_-_Nu...28max_num_value_n.29



and the error


Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 4 years 2 months ago by Joffm.
The following user(s) said Thank You: DenisChenu, holch
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose