Skip to main content

Developer README for the surveycto adaptor


Language SurveyCTO

Language Pack for building expressions and operations to make HTTP calls to SurveyCTO.


sample configuration

"username": "",
"password": "supersecret",
"instanceName": "openfn_test"


fetchSubmissions(1,2,3) takes three arguments:

  1. the formId of the form on SurveyCTO

  2. the initialAfterDate, a date string or UNIX timestamp which instructs the job to only fetch submissions after a certain date. After the first run of the job, subsequent runs will only fetch NEW submissions.

  3. the postUrl is where the wide-format JSON representation of each form submission should be sent. Note that a formId key will be added to each form submission for later filtering/routing.

sample fetchSubmissions expression

// formId on SurveyCTO server
// initialAfterDate: this will only be accessed if "lastSubmissionDate" is empty in your job_state".
// After the initial run of the job, OpenFn will only pull new submissions from SurveyCTO.
'Aug 29, 2016 4:44:26 PM',
// postUrl is where you want to send the JSON submissions, appended with a new "formId" key


Clone the repo, run npm install.

Run tests using npm run test or npm run test:watch

Build the project using make.