onaio / ona.R

Ona Plugin for R
https://github.com/onaio/ona.R
5 stars 10 forks source link

Downloading only new submissions #26

Open mkaranja opened 3 years ago

mkaranja commented 3 years ago

Hi, I have a cron-job script running every day and it's starts by download the data from ona. Data is downloaded as a whole set(4848 Records) which consumes lots of memory and may time out which in turn terminates the script. Is it possible to implement download of only new submissions? I'm thinking of a function to count number of records and can be used to subset data and only download a subset.

Example, previousNumberOfRecords <- numberOfSubmissions() # saved on disk currentNumberOfRecords <- numberOfSubmissions()

onaDownload(formID, account, user, password)[previousNumberOfRecords:currentNumberOfRecords,]

Thank you