Welcome to the LimeSurvey Community Forum

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

SOLVED:Can EM be used in attribute_X? (error in manual)

  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago - 4 years 4 months ago #192136 by bulgin
Can expression manager be used to either show a value or leave the field blank in CPD Attribute_X's?

Just an FYI in the manual for expression manager manual.limesurvey.org/Expression_Manager_examples under the caption "Using hidden equation question to autofill an answer" I believe the example given is missing an opening curly bracket {
Last edit: 4 years 4 months ago by bulgin.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #192140 by DenisChenu
Replied by DenisChenu on topic Can EM be used in attribute_X? (error in manual)

bulgin wrote: Can expression manager be used to either show a value or leave the field blank in CPD Attribute_X's?

No, you can use only TOKEN:ATTRIBUTE_X

Then : when copying the CPDB user : copy the attribute at same time.

bulgin wrote: Just an FYI in the manual for expression manager manual.limesurvey.org/Expression_Manager_examples under the caption "Using hidden equation question to autofill an answer" I believe the example given is missing an opening curly bracket {

Fixed, but anyone with a LS account can fix the manual :)

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.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #192156 by bulgin
Thank you Denis. Can you provide an example of the formula used in Attribute_1, for example? From your response it looks like it could be:

TOKEN:EMAIL

and that would input the the value a survey participant entered into the email field question into the Attribute_1 field?

What I'm trying to arrive at is a value populating the Attribute_1 but only if the question had an answer. If it was left blank, then nothing gets entered into Attribute_1.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #192157 by DenisChenu
Replied by DenisChenu on topic Can EM be used in attribute_X? (error in manual)
{TOKEN:ATTRIBUTE_1} manual.limesurvey.org/Expression_Manager#Access_to_Variables

What I'm trying to arrive at is a value populating the Attribute_1 but only if the question had an answer. If it was left blank, then nothing gets entered into Attribute_1.

You can't populate token attribute with response inside survey.

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.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #192159 by bulgin
Ok. thank you. Your plugin does but there is no method within the plugin to change variables and test the logic. That's okay. Just needed clarification.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #192160 by DenisChenu
Replied by DenisChenu on topic Can EM be used in attribute_X? (error in manual)

bulgin wrote: Ok. thank you. Your plugin does but there is no method within the plugin to change variables and test the logic. That's okay. Just needed clarification.


My plugin ? He does the validation directly and show the error


But if you don't want to update : using : expression returning [empty] string : don't update (if i don't make error).

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.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #192161 by bulgin
Perfect!
The topic has been locked.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #192163 by bulgin
So using DenisChenu updateTokenByResponse plugin I am now able to test the input field of "email" and if something is there, use the input value or, if it's blank, enter an empty string.

{if(email,"{email}"," ")}

The above formula is put into the plugin at:

Surveys | Plugin Manager | updateTokenByResponse | Value for attribute 2


FYI: DenisChenu's updateTokenByResponse must already have been installed and activated.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #192164 by DenisChenu
{if(email,"{email}"," ")}

???? You enter {email} as value ?

In my opinon {email} can, do the trick. If email is empty : it don't update the attribute. It's better no ?

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.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #192165 by bulgin
In my setup if I enter {email} then I see the actual string {email} in attribute_X.

But let me re-test. You may be correct. Standby.
The topic has been locked.
  • bulgin
  • bulgin's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
4 years 4 months ago #192166 by bulgin
You are correct - all that is needed is to put {email} in attribute_X and it will be blank if nothing is entered.

My mistake previously was that I had a formula in the survey's "Simple Plugin" for attribute_X.

My mistake. DenisChenu is correct!
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 4 months ago #192170 by tpartner

DenisChenu is correct!

Yup, almost always! :)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose