Welcome, Guest
Username: Password: Remember me

TOPIC: Using Expressions as Default value in free-text field

Using Expressions as Default value in free-text field 6 months 2 weeks ago #104638

  • Jondays
  • Jondays's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Thank you received: 1
  • Karma: 0
Hello,

I've been trying without success to use Expressions (within {}) to use a previously entered free text answer (or any answer) into a new free text field. I explain.

In question Group1, Q1 free text. The user enters his answer. (answer is Hello)
In question Group1, Q2 is radio button. Users selects A3. (A3 answer is World)

In question Group2. Using the default answer button, I set the default answer for this question to be:
This answer should be: {Q1.shown} and {Q2.shown} !

When loading the survey, I get:
When I do that, what I get is: This answer should be: and !
rather than: This answer should be: Hello and World !

When I enter text manually to use as default, no problem.

When I use answers from a list, droplist, array, etc, it works only if there is already an answer set as default when the survey loads. Else, the text box stays empty.

Expressions work well in other sections of survey (when used as filters, or to populate questions)

I hope my question makes sense

Thanks

Jon
The administrator has disabled public write access.

Using Expressions as Default value in free-text field 6 months 2 weeks ago #104645

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6256
  • Thank you received: 799
  • Karma: 239
In a grpup by group survey ?

It must be OK !

Can you provide a little "survey logic file" screen shot ?
The administrator has disabled public write access.
The following user(s) said Thank You: Jondays

Using Expressions as Default value in free-text field 6 months 2 weeks ago #104667

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4119
  • Thank you received: 760
  • Karma: 346
Better yet, can you provide a very small sample survey?
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.

Using Expressions as Default value in free-text field 6 months 2 weeks ago #104719

  • Jondays
  • Jondays's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Thank you received: 1
  • Karma: 0
I attached the survey structure of that demo. Also a link of the working survey. I would like that during the survey, some text fields be populated by answers from previous questions, in previous groups.

In this example, in the default answer text field I entered:
{Q1.shown}, {Q2.shown}, {Q3.shown}, {Q4.shown}, {Q5.shown}

I however only get the ,

You can import the survey structure on your own platform to test it, or follow this link. You have to answer the first 5 questions, then next, then you should see your answers in the textbox... Which we don't...

www.indexresearch.ca/sr/index.php?r=surv...x/sid/465241/lang/en


File Attachment:

File Name: limesurvey_survey_465241.lss
File Size: 20 KB


Thanks for your help!
The administrator has disabled public write access.

Using Expressions as Default value in free-text field 6 months 2 weeks ago #104720

  • Jondays
  • Jondays's Avatar
  • OFFLINE
  • Fresh Lemon
  • Posts: 3
  • Thank you received: 1
  • Karma: 0
A bit more info. When I follow the link from the message I just sent, it works! However, when I follow the survey link from the admin panel in limesurvey, or when I enter the address manually in the address bar, the box stays empty (except for comas).

Any insight?
The administrator has disabled public write access.
The following user(s) said Thank You: DenisChenu

Using Expressions as Default value in free-text field 6 months 2 weeks ago #104721

  • tpartner
  • tpartner's Avatar
  • OFFLINE
  • LimeSurvey Team
  • Posts: 4119
  • Thank you received: 760
  • Karma: 346
This is odd. It works fine if you disable the index feature but there are no JS errors.

Please file a bug report.


.
Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

LimeSurvey is open-source and run entirely by volunteers so please consider donating to support the project.
The administrator has disabled public write access.
The following user(s) said Thank You: Jondays

Using Expressions as Default value in free-text field 6 months 2 weeks ago #104739

  • DenisChenu
  • DenisChenu's Avatar
  • OFFLINE
  • Moderator Lime
  • Posts: 6256
  • Thank you received: 799
  • Karma: 239
@Jondays: thank you : bugs.limesurvey.org/view.php?id=8678
The administrator has disabled public write access.
Moderators: ITEd
Time to create page: 0.122 seconds
Donation Image