Welcome to the LimeSurvey Community Forum

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

Attribute token on array number

  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 year 10 months ago #241832 by brais24
Attribute token on array number was created by brais24
Please help us help you and fill where relevant:
Your LimeSurvey version: 3.25.6
Own server or LimeSurvey hosting: Own
Survey theme/template: Fruity
==================
Hi there, i have one question today, i have an array text table (with only number allowed), and i want to prefill all the fields with the information stored on an attribute from the participants table, but i can't do it because array number dont have the option to put {TOKEN:ATTRIBUTE_3} for example.

The array dont need to be a number, y make it like that because all de data that i want to prefill is numeric, is there some way to do this? I attach de lss, lsq and lsg os the survey.

Thanks for the help.

File Attachment:

File Name: limesurvey..._246.lsg
File Size:29 KB

File Attachment:

File Name: limesurvey...8691.lsq
File Size:25 KB

File Attachment:

File Name: limesurvey...9245.lss
File Size:41 KB

Please Log in to join the conversation.

  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 10 months ago #241833 by Joffm
Replied by Joffm on topic Attribute token on array number
Use a question of type "equation" to fill the array
{Q5_SQ001_SQ001=TOKEN:ATTRIBUTE_1}
{Q5_SQ001_SQ002=TOKEN:ATTRIBUTE_2}
{Q5_SQ001_SQ003=TOKEN:ATTRIBUTE_3}

{Q5_SQ002_SQ001=TOKEN:ATTRIBUTE_x}
​​​​​​​...
​​​​​​​

Volunteers are not paid.
Not because they are worthless, but because they are priceless

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
1 year 10 months ago #241836 by tpartner
Replied by tpartner on topic Attribute token on array number
Perhaps with an IF condition to check if the question was answered...

Code:
{Q5_Y001_X001 = if(is_empty(Q5_Y001_X001), TOKEN:ATTRIBUTE_1, Q5_Y001_X001)}

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

Please Log in to join the conversation.

  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
1 year 9 months ago #242022 by brais24
Replied by brais24 on topic Attribute token on array number
It works, thanks for the help.

Please Log in to join the conversation.

Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose