Bug or user error: RPC call update_response()

More
6 months 2 weeks 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.

Note: If I asked something and forgot to say version, I am using LS 5.x.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217837 by tpartner
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.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217839 by Jmantysalo
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?

Note: If I asked something and forgot to say version, I am using LS 5.x.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217840 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217841 by Jmantysalo
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...".

Note: If I asked something and forgot to say version, I am using LS 5.x.

Please Log in to join the conversation.

More
6 months 2 weeks ago - 6 months 2 weeks ago #217842 by tpartner
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: 6 months 2 weeks ago by tpartner.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217843 by Jmantysalo
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.

Note: If I asked something and forgot to say version, I am using LS 5.x.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217844 by tpartner
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.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217845 by Jmantysalo
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.

Note: If I asked something and forgot to say version, I am using LS 5.x.

Please Log in to join the conversation.

More
6 months 2 weeks ago #217856 by DenisChenu

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

Please Log in to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now