API: export_responses_by_token - how to add token attributes

More
2 months 4 weeks ago #171608 by mfiora
mfiora created the topic: API: export_responses_by_token - how to add token attributes
Hello,
i'm using API to export to PDF all the completed responses.
I would like to add token attributes in the beginning of each response.

As you know if i specify the token attributes $aFields i only get the ones specified.
On the other hand i don't know how to get the whole list of "question identifiers" to rebuild the response (just like if $aFields is null).

Could you please help me in one way or the other? Is there a workaround?

Thanks,

Regards,

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago - 2 months 3 weeks ago #171657 by mfiora
mfiora replied the topic: API: export_responses_by_token - how to add token attributes
Hello,
i found a workaround. I just modified the export_responses_by_token function adding a $bFields variable in input.
$bFields is an array containing the token attributes fields names. Then i just merged the 2 arrays just after
if (is_null($aFields)) $aFields=array_keys(createFieldMap($iSurveyID,'full',true,false,$sLanguageCode));
$aFields = array_merge($bFields,$aFields);


Thanks,

Regards,
Last Edit: 2 months 3 weeks ago by mfiora.
The following user(s) said Thank You: LouisGac

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!