Welcome to the LimeSurvey Community Forum

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

LimeSurvey API fetch by using question code value

More
5 months 2 weeks ago #251833 by mriaz
I am working on a php function where i am fetching the survey responses. The function is giving me all the completed survey. But, I want to fetch the surveys where question code or question id contain a specific value. For example if my question code is "product" i want to show the survey responses where product has a specific value. 
I am trying to do like this:  
       
$filter = ["product"=> "120482"];
        // Retrieve responses based on the filter
        $data = $myJSONRPCClient->export_responses($sessionKey, $surveyId, 'json', 'en', 'complete', $filter);

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 months 2 weeks ago #251834 by tpartner
There is no filter argument for that method.

- api.limesurvey.org/classes/remotecontrol...hod_export_responses

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
5 months 2 weeks ago #251835 by mriaz
Is there any other way to fetch the survey responses based on the value of the "product" question code?

Please Log in to join the conversation.

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
5 months 2 weeks ago #251854 by tpartner
As far as I know, you will need to filter in your PHP file.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: DenisChenu

Please Log in to join the conversation.

Lime-years ahead

Online-surveys for every purse and purpose