Create an asset in KoboToolbox
📜 This job is an official example from OpenFn.
Metadata​
- Name: Create an asset in KoboToolbox
- Adaptor:
@openfn/language-kobotoolbox
- Adaptor Version:
latest
- Created date unknown
- Updated date unknown
- Score: 100 (an indicator of how useful this job may be)
Key Functions​
Expression​
// Get all submissions of a specific form/asset and get the percentage of patients suspected of having covid-19
getSubmissions('aDReHdA7UuNBYsiCXQBr43');
fn(state => {
const results = state.data?.results;
const suspectedPatients = results.filter(
item => item['Please_select_sample_type'] === 'suspected_covid_19'
);
const suspectedCovidPatientsPercentage =
(suspectedPatients.length / results.length) * 100;
return { ...state, suspectedCovidPatientsPercentage };
});