- Posts: 14
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
How to fix 'undefined variables' in LimeSurvey questions/emails?
- Kyler_Hunter
- Topic Author
- Offline
- New Member
Less
More
4 years 4 months ago - 4 years 4 months ago #191956
by Kyler_Hunter
How to fix 'undefined variables' in LimeSurvey questions/emails? was created by Kyler_Hunter
Good Day,
I'm trying to create a custom email body by using EM . My test structure is:
Now the answer shows just fine, but the actual question I keep getting the "undefined variable" error when I place it in another question to check the logic. If I switch to the sub-question code
I do get the sub-question text. Any ideas why the actual question text won't show and I'm getting the "undefined variable" error?
LimeSurvey Version : 3.17
Question Type: Array
I'm trying to create a custom email body by using EM . My test structure is:
Code:
{P1Q1} - {P1Q1_SQ001.shown}
Now the answer shows just fine, but the actual question I keep getting the "undefined variable" error when I place it in another question to check the logic. If I switch to the sub-question code
Code:
P1Q1_SQ001.question
LimeSurvey Version : 3.17
Question Type: Array
Last edit: 4 years 4 months ago by Kyler_Hunter.
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
4 years 4 months ago #191958
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 How to fix 'undefined variables' in LimeSurvey questions/emails?
As far as I know, you cannot access the question text of question types that have sub-questions (array, multiple-text...), you can only access the sub-question text.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
4 years 4 months ago #191959
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to fix 'undefined variables' in LimeSurvey questions/emails?
Yes, you are right.
P1Q1 is a question with subquestions.
Therefore {P1Q1} is not defined.
Short time ago there was already a discussion that - at the moment - you cannot get the text of the question; only the text of the subquestions.
www.limesurvey.org/forum/design-issues/1...of-multiple-question
Joffm
P1Q1 is a question with subquestions.
Therefore {P1Q1} is not defined.
Short time ago there was already a discussion that - at the moment - you cannot get the text of the question; only the text of the subquestions.
www.limesurvey.org/forum/design-issues/1...of-multiple-question
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Kyler_Hunter
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 4 months ago #191960
by Kyler_Hunter
Replied by Kyler_Hunter on topic How to fix 'undefined variables' in LimeSurvey questions/emails?
Dang, I was hoping I wouldn't have to rewrite the questions completely for the email.
How does the Answer Table pull the text then? Or is that some complicated code in the back end.
How does the Answer Table pull the text then? Or is that some complicated code in the back end.
The topic has been locked.
- Joffm
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 12908
- Thank you received: 3975
4 years 4 months ago #191972
by Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
Replied by Joffm on topic How to fix 'undefined variables' in LimeSurvey questions/emails?
That's something different.
There is the table "lime_questions" in the dataset.
If you have access you may have a look.
You see that there is a field "parent_qid", where the reference between question text and subquestion text is established.
But the issue is that this access is mou published in the "access to variables"
manual.limesurvey.org/Expression_Manager...#Access_to_variables
Maybe we will see it in some version in the future.
Joffm
There is the table "lime_questions" in the dataset.
If you have access you may have a look.
You see that there is a field "parent_qid", where the reference between question text and subquestion text is established.
But the issue is that this access is mou published in the "access to variables"
manual.limesurvey.org/Expression_Manager...#Access_to_variables
Maybe we will see it in some version in the future.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
- Kyler_Hunter
- Topic Author
- Offline
- New Member
Less
More
- Posts: 14
- Thank you received: 0
4 years 4 months ago #191976
by Kyler_Hunter
Replied by Kyler_Hunter on topic How to fix 'undefined variables' in LimeSurvey questions/emails?
Unfortunately I do not have access to see the back-end. Ah well, cross fingers we will be able to do it in future releases. Thanks!
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
4 years 4 months ago #191985
by DenisChenu
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 How to fix 'undefined variables' in LimeSurvey questions/emails?
It's in 4.0 : github.com/LimeSurvey/LimeSurvey/blob/f8...orAll/config.xml#L12Kyler_Hunter wrote: Unfortunately I do not have access to see the back-end. Ah well, cross fingers we will be able to do it in future releases. Thanks!
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 following user(s) said Thank You: tpartner
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
4 years 4 months ago #192001
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 How to fix 'undefined variables' in LimeSurvey questions/emails?
@DenisChenu, nice!
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- tpartner
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 10104
- Thank you received: 3593
4 years 4 months ago #192003
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 How to fix 'undefined variables' in LimeSurvey questions/emails?
To expand on Denis' post, in 4.x you can activate the "expressionQuestionForAll" plugin and then an expression like {Q1.question}, where Q1 is an array, will be valid.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu
The topic has been locked.
- DenisChenu
- Offline
- LimeSurvey Community Team
Less
More
- Posts: 13637
- Thank you received: 2491
4 years 4 months ago #192012
by DenisChenu
I hope i found time to allow surveh plugin (expression new function) by twig
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 How to fix 'undefined variables' in LimeSurvey questions/emails?
You can be insterested by such plugin : github.com/LimeSurvey/LimeSurvey/blob/f8...pleFunctions.php#L12tpartner wrote: @DenisChenu, nice!
I hope i found time to allow surveh plugin (expression new function) by twig
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.