Welcome to the LimeSurvey Community Forum

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

Save custom data to a field in the database

  • samh11
  • samh11's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
5 years 7 months ago #172791 by samh11
I would like to generate HTML code and save it to a column/field in the database.

I've created a hidden question with 'sHTML' code which corresponds to the column/field
in the survey table I would like to save the HTML.

I've also created a plugin and it handles the afterSurveyComplete event.

Can I read the survey/response from the database and then modify the sHTML column
and update the modified record to the database?

I've tried reading the survey/response from the database using the internal API calls, but it doesn't appear to read the record.

I assume the record is created at this point since I'm in the afterSurveyComplete but maybe the record hasn't been created yet.

Does anyone know how to go about handling the above situation?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 years 7 months ago #172812 by tpartner
Replied by tpartner on topic Save custom data to a field in the database
The record is created after submission of the first question page, regardless of whether the survey is complete.

If you cannot load the hidden (presumably long-text-type) question from within the survey, how about using the API update_response() method - api.limesurvey.org/classes/remotecontrol...thod_update_response .

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