Welcome to the LimeSurvey Community Forum

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

Problem Fetching Attribute to Dynamically Apply to Template

  • kripp88
  • kripp88's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #123114 by kripp88
Hey all, I am on Version 2.00+ Build 130802.

I am trying to apply an attribute value to a template to dynamically display an image based on the value for that particular person. I have the attribute setup as "customer_name" and for a specific person i have given them the value of "test". I have uploaded test.png through the template editor. When I try any of the following in my template it is coming back as an undefined variable. Am I missing something?
  • <img src="{TEMPLATEURL}{TOKEN:customer_name}.png" />
  • <img src="{TEMPLATEURL}{customer_name}.png" />
  • <p>{TOKEN:customer_name} </p>

I was trying to copy, this www.limesurvey.org/en/community-services...vey-general-settings
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #123126 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.
The topic has been locked.
  • kripp88
  • kripp88's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #123145 by kripp88
Hey Denis thanks for the reply, that was helpful. I understand the correct syntax now, but for some reason it is outputting all of my values at empty. The below still result in "" even though they are all populated on the token.

<img src="{TEMPLATEURL}{TOKEN:ATTRIBUTE_16}.png" />
<p>{TOKEN:ATTRIBUTE_16}</p>
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #123153 by DenisChenu
TOKEN: can be used only if
- There are a existing token (preview don't work)
- Survey is NOT anonymous

Denis

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.
  • kripp88
  • kripp88's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #123156 by kripp88
Hmm, I do have tokens and the survey isn't anonymous and I'm actually clicking a link to take the survey. Do you have any other ideas why this wouldn't be working? It seems to be recognizing the attribute, but just not pulling the value. I can provide screenshots if necessary.

Thank you,
Kyle
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #123217 by DenisChenu
Maybe a bug in 2.00+ Build 130802. ?

Don't know.

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.
  • kripp88
  • kripp88's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #123253 by kripp88
Any help would greatly be appreciate, I seem to be stuck. When clicking the link to take the survey the source is shown as
"<img src="/limesurvey/upload/templates/.png" />" Meaning that {TOKEN:ATTRIBUTE_16} is coming in as empty.

Thanks,
Kyle
The topic has been locked.
  • holch
  • holch's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #123255 by holch
As Dennis says, it is hard for us to help with a problem that we can't reproduce. The version you are using is quite old already and in those 2 years Limesurvey has changed quite a bit. It is possible that this is a bug or problem in this specific version.

You could try and upload an example to the demo version here on limesurvey.org and see if your code works here, to rule out a problem with your installation / version.

I answer at the LimeSurvey forum in my spare time, I'm not a LimeSurvey GmbH employee.
No support via private message.

The topic has been locked.
  • kripp88
  • kripp88's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #123605 by kripp88
Thanks for the idea Holch. I just tried with the demo version and it still doesn't appear to be working. Can you take a look at Survey:578422 which I used to test out adding an attribute and then making it appear in the 'copy_of_default' template under welcome.pstpl via {TOKEN:attribute_1}.

demo.limesurvey.org//index.php?r=survey/...QfbAJAohEpeQ/lang/en

Thanks,
Kyle
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
8 years 8 months ago #123606 by DenisChenu

DenisChenu wrote: Hi,

manual.limesurvey.org/Expression_Manager#Access_to_Variables

{TOKEN:ATTRIBUTE_2}

attribute != ATTRIBUTE

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.
  • kripp88
  • kripp88's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
8 years 8 months ago #123608 by kripp88
Oh ok thank you I was able to fix it and it is now working in the demo version. It is still not working on my version so there must have been a bug in, Version 2.00+ Build 130802.

Thanks,
Kyle
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose