Welcome to the LimeSurvey Community Forum

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

Attribute token on array number

More
2 years 5 months ago #241832 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:28.87 KB

File Attachment:

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

File Attachment:

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

Please Log in to join the conversation.

More
2 years 5 months ago #241833 by Joffm
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.

More
2 years 5 months ago #241836 by tpartner
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.

More
2 years 5 months ago #242022 by brais24
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