Closed aleksa-krolls closed 3 years ago
@aleksa-krolls , I have updated the job to handle 1 or multiple attendance entries
and I also have some mapping questions added in-line. Let me know if this works after addressing these questions.
@chaiwa-berian looks like this version of state (see #1 above) does have intervention_name
. Can you please make sure the job works for this state also? https://www.openfn.org/projects/pd3yk4/messages/mdbqpvpn
I'm working on finding a different version of state for #2 where there are multiple attendance entries. In the meantime, pls make sure the CommCare_Ext_ID__c
is set correctly and contains no undefined
values for the above.
@aleksa-krolls This job is now correctly resolving intervention_name
but it fails on ids
not being found in Person__c
and Event__c
. Kindly verify we are pointing to the right paths or that the ids
exist in Salesforce
. See a re-run with this message: https://www.openfn.org/projects/pd3yk4/messages/mdbqpvpn
See issue #9 for a similar fix implemented.
Issue
Job
upsertAttendance.js
currently fails because it cannot handle an array of multiple Attendance records. If only 1 attendance is entered, CommCare form outputs an object (item: {...}
), but outputs an array if there are multiple attendance entries (item: [{...},{...}]
). We need to update the job to handle both scenarios.We tried editing the job to add
each(...)
but it's now failing with this error: https://www.openfn.org/projects/pd3yk4/runs/rmkw5nwdTypeError [Error]: fields is not iterable (cannot read property Symbol(Symbol.iterator))
Can you please take a look and make sure this job will succeed when Attendance for either 1 or multiple people is submitted?
expression
https://github.com/OpenFn/grassroot-soccer/blob/master/jobs/upsertAttendance.js
state
To test, please run these^ on prod to verify the changes you've made.