cloudyr / limer

A LimeSurvey R Client
MIT License
67 stars 37 forks source link

update_response #61

Open bochhun opened 1 year ago

bochhun commented 1 year ago

I am having trouble using call_limer to update a response. I have both the response id and token as headers, along with the response to update. I get the following error message:

> update_response <-call_limer(method = "update_response", 
                            params = list(iSurveyID = 123456,
                                          ResponseData = df))

> update_response
[1] "Error: Missing response identifier (id|token)."

Any ideas would be helpful!

r0bis commented 1 year ago

It works. But I had a bit similar issues when testing. I wrote it up in a post on SO.

You are missing a list of aResponseData, two arrays/lists are needed - see the answer on SO

In brief: Routine supports only single response updates. Response to update will be identified either by the response id, or the token if response id is missing from params provided. Routine is only applicable for active surveys with alloweditaftercompletion = Y.

To update multiple responses you will need to write a simple loop. (I have an example somewhere)