Using $aFields with export_responses

Plus d'informations
il y a 2 ans 3 mois #149091 par conwa02976
I have seen this question in a couple other topics but have not seen a real good answer yet. We are using Ruby to call the export_responses method but we need to pull a field from the survey participants table and this parameter looks like it will do it but I can't seem to format the array correctly. If I just wanted to pull one field, we will say it is Field1, from the participants table for all completed surveys with the data, how would I format that array to work as a parameter?

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 2 ans 3 mois #149104 par conwa02976
Okay, so I got this to work and I figured out that when you add that Optional Selected Fields array parameter to the method you only get back the fields that you have in that array. You do not get back the full response dataset. Bummer!!!

Now, my problem is when I add either the "qid" or "title" for a question in that array I don't get anything back. I only get the data for the fields I am pulling from the survey participants table, no actual response data.

When I compare this to the manual Export from the quesXS suite it is like some kind of 'AND' is being performed. When I choose what statements I want exported from the 'Select columns' listbox AND what token fields I want from the 'Choose token fields' listbox then I get back all of the data responses AND whatever I choose from the token fields. That is expected.

On the other had, from the API when I do not add the Optional fields array I get back all of the data responses like I want but when I add the Optional fields array parameter to the method I only get back the field(s) from the survey participants table, I get nothing back from the data layer. I would think the API export_responses would match the queXS front end manual capability and give you everything back, the data responses AND the Optional fields that have been chosen.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 ans 3 mois #149108 par jelo
Réponse de jelo sur le sujet Using $aFields with export_responses

conwa02976 écrit: I would think the API export_responses would match the queXS front end manual capability and give you everything back, the data responses AND the Optional fields that have been chosen.

Why should that be the case? As far as I'm aware of queXS the integration with LimeSurvey is via accessing the database directly. Not loosely coupled via an API.
Or is the transition already done? Looks like WIP:
code.launchpad.net/~adamzammit/quexs/quexs-remotelime

I think you should open a bugreport on the tracker.
The API code isn't used that much in comparism to the rest of the codebase.
If it is no bug, it might be a feature request.

The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 ans 3 mois #149114 par holch
Réponse de holch sur le sujet Using $aFields with export_responses
ahhhh, good find Jelo!

Would be great to have a queXS that uses only the API.

I'm not a LimeSurvey GmbH member. I answer at the LimeSurvey forum in my spare time. No support via private message.
Some helpful links: Manual (EN) | Question Types | Workarounds

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 3 mois 1 jour #181676 par mguacci
Is ther a way to include all fields to export, including participant custom attributes?

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 3 mois 1 jour - il y a 3 mois 1 jour #181762 par tpartner
If the survey is not anonymous, you can export the token data.

- manual.limesurvey.org/Export_responses#Export_responses

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Dernière édition: il y a 3 mois 1 jour par tpartner.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 3 mois 18 heures #181777 par mguacci
First of all, thank you for your answer. I understand how to export all data via UI. Is there a way to do the same using Remote Control API?
I didn't find any example about filling $aFields parameter for method export_responses.

Thank you.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 3 mois 15 heures #181780 par DenisChenu
With current remote control API : you can :
1. Export response
2. Export related token
And you have what you want

Else you can extend Limesurvey remote control API .

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 .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 3 mois 14 heures #181783 par mguacci
DenisChenu, I'm using ajax to invoke Remote Control Api, with this params configuration:

var params = {
"method": exportResponsesFunction,
"params": {
"sSessionKey" : sessionKey,
"iSurveyID" : survey.sid,
"sDocumentType" : "xls",
"sLanguageCode" : null,
"sCompletionStatus" : "all",
"sHeadingType" : "full",
"sResponseType" : "long",
"aFields": ["firstname","lastname","email","attribute_1","attribute_2","attribute_3"]
},
jsonrpc: "2.0",
id: "exportResponses"
};


But result is always the same: no token data appears in the xls file.

How have I to fill $aFields param? I didn't find examples on the Web.

I would appreciate if you could give me any kind of suggestion.

Thank you.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 3 mois 11 heures #181789 par DenisChenu
I write : do it in 2 times export the responses, and after export related participant : api.limesurvey.org/classes/remotecontrol...rticipant_properties
"method": exportResponsesFunction,
?
api.limesurvey.org/classes/remotecontrol...hod_export_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 .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 3 semaines #182084 par evently
Hi,
to get particular questions back with the remote control the aFields array should be an array as you have, but the questions need to be added not with their questioncodes but with their database name, eg 123456X789X10 so {SURVEYID}X{GROUPID}X{QUESTIONID}. But you would need to get the internal code for every question you want to export..

I recently had the same problem, so I wrote a helper for my php remote control package, not sure if it would help you with ruby but it's here: github.com/evently-nl/limeremote/blob/ma...emoteHelperTrait.php

Best regards,
Stefan (stefan(at)evently.nl)
Evently
Looking for beta testers: interested in connecting Zapier to Limesurvey or
creating Telegram and Messenger bots from Limesurvey? Email me!

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 3 semaines #182097 par DenisChenu

evently écrit: …
I recently had the same problem, so I wrote a helper for my php remote control package, not sure if it would help you with ruby but it's here: github.com/evently-nl/limeremote/blob/ma...emoteHelperTrait.php

It work only for single question type, not for multiple or specific (ranking for example).
gitlab.com/SondagesPro/RemoteControl/rcA...ntrolHandler.php#L51
or
gitlab.com/SondagesPro/coreAndTools/getQ...eyCodeHelper.php#L65

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Les utilisateur(s) suivant ont remercié: evently

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!