Skip to content

Instantly share code, notes, and snippets.

@taylordowns2000
Last active October 13, 2020 10:18
Show Gist options
  • Save taylordowns2000/5d3f48075784a6c112feb8c8376f0ded to your computer and use it in GitHub Desktop.
Save taylordowns2000/5d3f48075784a6c112feb8c8376f0ded to your computer and use it in GitHub Desktop.
// Note that for Postgres you're mapping data from questions to specific columns
upsert('assessment_site', 'ON CONSTRAINT assessment_site_pkey', {
study_id: 1000,
site_id: 1001,
admin_level_3: state.data.body['survey_info/district'],
site_name: state.data.body['survey_info/village'],
enumerator_name: state.data.body.surveyorName,
date_of_submission: state.data.body.dateCaptured,
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment