Welcome to the LimeSurvey Community Forum

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

Bug or user error: RPC call update_response()

  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 9 months ago #217835 by Jmantysalo
How should RPC call update_response work? In my test I always get "Error: Invalid Column names supplied:", and

$aBasicDestinationFields = $oSurveyDynamic->tableSchema->columnNames;

at the line 2967 on remotecontrol_handle.php seems to put nothing on $aBasicDestinationFields-variable.

I am using Version 5.0.4+210614.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #217837 by tpartner
Replied by tpartner on topic Bug or user error: RPC call update_response()
Can you provide a code snippet?

The column names must be the SGQ values (111111X22X33 or 111111X22X33_SQ001), not the question/sub-question codes.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 9 months ago #217839 by Jmantysalo
Replied by Jmantysalo on topic Bug or user error: RPC call update_response()
Aaarghs. How is this not documented? Why I got a headache when I look at the RPC docs?

How to get SGQ from question code?
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #217840 by tpartner
Replied by tpartner on topic Bug or user error: RPC call 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.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 9 months ago #217841 by Jmantysalo
Replied by Jmantysalo on topic Bug or user error: RPC call update_response()
Ah, true. I meant how to get the SQGA from the API.

My code is something like "read answers from survey X, and by that information add participants to surveys A, B and C". Would be nice if I could just say to normal user "when making X, use question code 'abcd' and my code will use it to...".
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago - 2 years 9 months ago #217842 by tpartner
Replied by tpartner on topic Bug or user error: RPC call update_response()
I am confused how you would use update_response for that workflow.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 2 years 9 months ago by tpartner.
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 9 months ago #217843 by Jmantysalo
Replied by Jmantysalo on topic Bug or user error: RPC call update_response()
Better would be delete_response, but there is no such function. (see bugs.limesurvey.org/view.php?id=17413 )

So I would like to change response, for example add "DONEALREADY" to the start of some answer.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #217844 by tpartner
Replied by tpartner on topic Bug or user error: RPC call update_response()
I still don't see how that relates to retrieving data from one survey and then adding participants to other surveys.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • Jmantysalo
  • Jmantysalo's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
2 years 9 months ago #217845 by Jmantysalo
Replied by Jmantysalo on topic Bug or user error: RPC call update_response()
Would be logical to have a way for marking already retrieved data. Now I must check if there already is same participant so that the code does not add it again.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 9 months ago #217856 by DenisChenu
Replied by DenisChenu on topic Bug or user error: RPC call update_response()

Ah, true. I meant how to get the SQGA from the API.

My code is something like "read answers from survey X, and by that information add participants to surveys A, B and C". Would be nice if I could just say to normal user "when making X, use question code 'abcd' and my code will use it to...".
 
Plugin done for this : gitlab.com/SondagesPro/RemoteControl/rcAddReponseCode
Usage of EM code to update responses.

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 following user(s) said Thank You: Jmantysalo
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose