- Posts: 3
- Thank you received: 0
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
API - Get complete surveys is a specific timerange
3 years 3 months ago #191590
by nicolepe
API - Get complete surveys is a specific timerange was created by nicolepe
Hi,
I would like to use LimeSurvey to provide surveys and use the results to elaborate results, making personalized graph and reports.
I am able to connect to the server via API and get data of a specific survey and token, using the export_responses_by_token call.
What I would like to obtain, is the list of surveys completed in a timerange (eg. the last 24 hours). Is there a way to use the API and get this list ?
Many thanks,
Nicola.
I would like to use LimeSurvey to provide surveys and use the results to elaborate results, making personalized graph and reports.
I am able to connect to the server via API and get data of a specific survey and token, using the export_responses_by_token call.
What I would like to obtain, is the list of surveys completed in a timerange (eg. the last 24 hours). Is there a way to use the API and get this list ?
Many thanks,
Nicola.
The topic has been locked.
3 years 3 months ago #191597
by tpartner
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic API - Get complete surveys is a specific timerange
Assuming the survey is non-anonymous and you are recording the date stamp, you can can use the API export_responses() method with something like this as the $aFields argument:
Then you should be able to filter the results by the submitdate to get the relevant tokens.
Code:
$aFields = array('submitdate', 'token');
Then you should be able to filter the results by the submitdate to get the relevant tokens.
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: nicolepe
The topic has been locked.
3 years 3 months ago #191696
by nicolepe
Replied by nicolepe on topic API - Get complete surveys is a specific timerange
Hi Tony,
thanks for the reply, unfortunately, this is not what I am looking for.
I have a survey that runs for many days, with many participants. I am developing statistics pages in which I show some data about all the responses received. I would like to be able to update the data each day with the responses of the previous day.
Handling it the way you suggest, will force the system to download all the responses every day and discard all those that are not from a specific day.
I am wondering if there is a way to receive only the responses from a specific day.
Thanks,
Nicola.
thanks for the reply, unfortunately, this is not what I am looking for.
I have a survey that runs for many days, with many participants. I am developing statistics pages in which I show some data about all the responses received. I would like to be able to update the data each day with the responses of the previous day.
Handling it the way you suggest, will force the system to download all the responses every day and discard all those that are not from a specific day.
I am wondering if there is a way to receive only the responses from a specific day.
Thanks,
Nicola.
The topic has been locked.
- DenisChenu
-
- Away
- LimeSurvey Community Team
-
Less
More
- Posts: 12895
- Thank you received: 2371
3 years 3 months ago #191741
by DenisChenu
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.
Replied by DenisChenu on topic API - Get complete surveys is a specific timerange
Maybe it's best to use export_responses
with iFromResponseID by parameters ?
Since there are no filter in export response or export_response by token : you can create your own function : extensions.sondages.pro/development-and-...i/documentation.html
with iFromResponseID by parameters ?
Since there are no filter in export response or export_response by token : you can create your own function : extensions.sondages.pro/development-and-...i/documentation.html
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 topic has been locked.
3 years 3 months ago #191746
by tpartner
If that doesn't suit you could do it with a direct SQL query.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Replied by tpartner on topic API - Get complete surveys is a specific timerange
My suggestion would not get all of the response data, it would only get the token and submitdate values - a considerably smaller returned result.Handling it the way you suggest, will force the system to download all the responses every day and discard all those that are not from a specific day.
If that doesn't suit you could do it with a direct SQL query.
Cheers,
Tony Partner
Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
- Rayarltris_192345
-
- Offline
- Banned
-
Less
More
- Posts: 2
- Thank you received: 0
2 years 9 months ago #201097
by Rayarltris_192345
Replied by Rayarltris_192345 on topic API - Get complete surveys is a specific timerange
Hi Nicola -- did you end up finding a solution? I'm facing a similar challenge... I have a survey to be completed by individuals from different groups and, for report purposes, I'd like to selectively retrieve responses filtered by group ids (which are captured by a hidden variable).
The topic has been locked.