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
  • cairomckenzie's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 weeks ago #151947 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
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.
More
7 years 3 weeks ago #151959 by web_digital
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.
The topic has been locked.
  • cairomckenzie
  • cairomckenzie's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 weeks ago #151960 by cairomckenzie
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.
The topic has been locked.
More
7 years 3 weeks ago #151965 by web_digital
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 topic has been locked.
More
7 years 3 weeks ago #151968 by jelo
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
  • cairomckenzie's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
7 years 3 weeks ago #152008 by cairomckenzie
Version 2.06+ SondagesPro Build 1.0.26
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose