Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last_response still fetches all responses #153

Closed
weiyangtham opened this issue Apr 12, 2020 · 5 comments
Closed

last_response still fetches all responses #153

weiyangtham opened this issue Apr 12, 2020 · 5 comments

Comments

@weiyangtham
Copy link

weiyangtham commented Apr 12, 2020

I'm otherwise able to get the responses with fetch_survey, but even when I enter a response ID into last_response, I get all the responses instead of only those after the response ID. I've tried those on a couple of different projects without success

@juliasilge
Copy link
Collaborator

Well. This is rather embarrassing. 🙈

I haven't noticed this since taking over maintenance over this package, but the last_response argument doesn't actually do anything. The argument is checked but then never actually used. Specifically, it is not included in the JSON payload sent to the Qualtrics API. This is probably because this is not one of the parameters of the API.

So where does that leave us? I am going to need to deprecate this argument because the API doesn't work like this. Thanks for bringing this to my attention, and I apologize for the confusion!

@weiyangtham
Copy link
Author

weiyangtham commented Apr 12, 2020

Good to know and thank you! the package is a lifesaver

@juliasilge
Copy link
Collaborator

juliasilge commented Apr 12, 2020

Just found this in check_params():

  # No longer used:
  # if ("last_response" %in% names(args)) {
  #   if (!is.null(args$last_response)) {
  #     assert_lastResponseId_string(args$last_response)
  #   }

@juliasilge
Copy link
Collaborator

The warning users will see will look like this:

Warning messages:
1: The `last_response` argument of `fetch_survey()` is deprecated as of qualtRics 3.1.2.
This warning is displayed once every 8 hours.
Call `lifecycle::last_warnings()` to see where this warning was generated. 

@jmobrien
Copy link
Collaborator

jmobrien commented Apr 16, 2020

Sorry, @juliasilge. You should brush off that embarrassment and send it my way.

The older response API endpoint DID have had a lastResponseId param that this got passed to, and I neglected to document the change when it was removed in #135.

The new API doesn't support anything quite like it, though. There are "continuation tokens" but we don't support them yet, and they require some forethought to work.

However, @weiyangtham, I think you could get the same effect by pulling RecordedDate from the last response and passing that to start_date.

You'd need to format it properly, though, see here:
https://api.qualtrics.com/docs/dates-and-times

EDIT: this won't work yet because of how the payload is internally constructed. We'd need to handle start_date a bit more flexibly first, to include times as well as dates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants