Create new events
📜 This job is an official example from OpenFn.
Metadata​
- Name: Create new events
- Adaptor:
@openfn/language-dhis2
- Adaptor Version:
latest
- Created date unknown
- Updated date unknown
- Score: 100 (an indicator of how useful this job may be)
Key Functions​
create
Expression​
// ----
// Create new events in DHIS2 using a generic JSON message, submitted by
// Taylor Downs @ OpenFn, Co-authored by @mtuchi
// ---
create('events', {
program: 'eBAyeGv0exc',
orgUnit: 'DiszpKrYNg8',
occurredAt: $.meta.date,
status: 'COMPLETED',
storedBy: 'admin',
geometry: {
type: 'POINT',
coordinates: [59.8, 10.9],
},
dataValues: [
{
dataElement: 'qrur9Dvnyt5',
value: $.form.prop_a,
},
{
dataElement: 'oZg33kd9taw',
value: $.form.prop_b,
},
{
dataElement: 'msodh3rEMJa',
value: $.form.prop_c,
},
],
});