Welcome to the LimeSurvey Community Forum

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

Updating an attribute field when submit is pressed

  • solte98
  • solte98's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago - 7 years 3 months ago #146814 by solte98
Hi,

I am not a developer. But wanted to know if we can update custom token attribute fields e.g attrribute_1 after pressing the submit button.

if you can tell us what file the update sql statements are and give us an example that would be appreciated.

What we want to do is fill out those attribute fields after the survey is complete.

Also, can we pre-populate the attribute fields with default data when creating the tokens.

thank you
Last edit: 7 years 3 months ago by solte98.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146823 by tpartner

But wanted to know if we can update custom token attribute fields e.g attrribute_1 after pressing the submit button.

You can use the RemoteControl 2 API with the set_participant_properties() method to remotely modify token attributes.

Also, can we pre-populate the attribute fields with default data when creating the tokens.

You can do that in the CSV file when importing tokens - manual.limesurvey.org/Survey_participant...g.2Fexporting_tokens

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • solte98
  • solte98's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
7 years 3 months ago #146825 by solte98
the remotecontrol looks like an interesting solution for my reporting queries using other applications. However, what I wanted is the following:

1. when the participant presses 'submit' I want to be able to update token database fields (e.g attribute_1)
2. Where are the update sql commands written (what file?)
3. can someone give an example?

thank you
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146827 by tpartner

when the participant presses 'submit' I want to be able to update token database fields (e.g attribute_1)

Yes, I understand that.

Send an AJAX call from the thanks page to a remote script that uses the API to update the token attribute.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
7 years 3 months ago #146854 by DenisChenu
Hi,

New and hot : framagit.org/SondagePro-LimeSurvey-plugin/updateTokenByResponse

No documentation , work and tested in 2.6.1 version. Didn't test in 2.5X, but except "admin GUI" must work without any update.

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.

Lime-years ahead

Online-surveys for every purse and purpose