- Posts: 7
- Thank you received: 3
Welcome to the LimeSurvey Community Forum
Ask the community, share ideas, and connect with other LimeSurvey users!
Remotecontrol2 list_participants - $aConditions JSON unexpected returns
- cairomckenzie
- Topic Author
- Offline
- New Member
Less
More
7 years 3 weeks ago #151947
by cairomckenzie
Remotecontrol2 list_participants - $aConditions JSON unexpected returns was created by cairomckenzie
I'm trying to get a filtered list of participants by passing some conditions in the list_participants request ($aConditions)
I've tried everyway I can imagine to format the JSON for the $aConditions parameter, and I keep yielding results that do not match the passed conditions. I'm working in a somewhat limited development environment, so I can't really tell what is happening on the server side to determine what could possibly be going wrong. I can only share what is being sent in the body, and then what is being returned in response
Then, what gets returned is:
As you can see - records that have dates ( and not just "N") are still being received. I have exhausted all my ideas about what/where I could be going wrong. The request appears to work otherwise. But that parameter has me completely stopped.
Can anybody help?
I've tried everyway I can imagine to format the JSON for the $aConditions parameter, and I keep yielding results that do not match the passed conditions. I'm working in a somewhat limited development environment, so I can't really tell what is happening on the server side to determine what could possibly be going wrong. I can only share what is being sent in the body, and then what is being returned in response
Code:
{ "method": "list_participants", "params": { "sSessionKey": "XXXXXXXXXX", "iSurveyID": XXXXX, "iStart": 0, "iLimit": 20, "bUnused": false, "aAttributes": ["completed"], "aConditions": { "completed": "N" } }, "id": 1 }
Then, what gets returned is:
Code:
{ "id": 1, "result": [{ "tid": "49", "token": "XXXXXX", "participant_info": { "firstname": "XXXXXX", "lastname": "XXXXXX", "email": "XXXXXX" }, "completed": "N" }, { "tid": "48", "token": "XXXXXX", "participant_info": { "firstname": "XXXXXX", "lastname": "XXXXXX", "email": "XXXXXXX" }, "completed": "2014-08-12 12:09" }, { "tid": "38", "token": "XXXXXX", "participant_info": { "firstname": "XXXXXX", "lastname": "XXXXXX", "email": "XXXXXX" }, "completed": "N" }, { "tid": "37", "token": "XXXXXX", "participant_info": { "firstname": "XXXXXX", "lastname": "XXXXXX", "email": "XXXXXX" }, "completed": "N" }, { "tid": "35", "token": "XXXXXX", "participant_info": { "firstname": "XXXXX", "lastname": "XXXXXX", "email": "XXXXXX" }, "completed": "2014-07-21 22:52" }, ], "error": null }
As you can see - records that have dates ( and not just "N") are still being received. I have exhausted all my ideas about what/where I could be going wrong. The request appears to work otherwise. But that parameter has me completely stopped.
Can anybody help?
The topic has been locked.
- web_digital
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
7 years 3 weeks ago #151959
by web_digital
Replied by web_digital on topic Remotecontrol2 list_participants - $aConditions JSON unexpected returns
Unfortunately the iLimit parameter actually limits the result set before the conditions are applied. (Would love to see that changed )
So in your case you have no uncompleted surveys in responses 1-20.
I have been bitten by this before!
Mat.
So in your case you have no uncompleted surveys in responses 1-20.
I have been bitten by this before!
Mat.
The topic has been locked.
- cairomckenzie
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 3
7 years 3 weeks ago #151960
by cairomckenzie
Replied by cairomckenzie on topic Remotecontrol2 list_participants - $aConditions JSON unexpected returns
Hello Mat,
I will adjust it and run - however based on the dataset I've listed above, it shows both complete AND incomplete responses (so I DO have uncompleted responses), when it should show ONLY non-completed surveys (where completed = "N").
If I'm honest though, I don't think that even if I do get this to work that I will be able to use it as I wish to - which is to literally only retrieve responses that occurred after a specific date. I don't think we can use greater than/less than operators in the conditions to carry that out.
Alex.
I will adjust it and run - however based on the dataset I've listed above, it shows both complete AND incomplete responses (so I DO have uncompleted responses), when it should show ONLY non-completed surveys (where completed = "N").
If I'm honest though, I don't think that even if I do get this to work that I will be able to use it as I wish to - which is to literally only retrieve responses that occurred after a specific date. I don't think we can use greater than/less than operators in the conditions to carry that out.
Alex.
The topic has been locked.
- web_digital
- Offline
- New Member
Less
More
- Posts: 3
- Thank you received: 0
7 years 3 weeks ago #151965
by web_digital
Replied by web_digital on topic Remotecontrol2 list_participants - $aConditions JSON unexpected returns
Oh yes - should have spotted that!
The attribute setting "completed":"N" does work in the queries i'm running, so maybe iLimit or another setting is doing something odd in your query.
You are correct in that it does not seem possible to use >= attribute settings - something I am also looking to use.
The attribute setting "completed":"N" does work in the queries i'm running, so maybe iLimit or another setting is doing something odd in your query.
You are correct in that it does not seem possible to use >= attribute settings - something I am also looking to use.
The topic has been locked.
- jelo
- Offline
- Platinum Member
Less
More
- Posts: 5033
- Thank you received: 1257
7 years 3 weeks ago #151968
by jelo
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
Replied by jelo on topic Remotecontrol2 list_participants - $aConditions JSON unexpected returns
What version of LimeSurvey is used?
The meaning of the word "stable" for users
www.limesurvey.org/forum/development/117...ord-stable-for-users
The topic has been locked.
- cairomckenzie
- Topic Author
- Offline
- New Member
Less
More
- Posts: 7
- Thank you received: 3
7 years 3 weeks ago #152008
by cairomckenzie
Replied by cairomckenzie on topic Remotecontrol2 list_participants - $aConditions JSON unexpected returns
Version 2.06+ SondagesPro Build 1.0.26
The topic has been locked.