Closed daissatou2 closed 3 years ago
@daissatou2 I implemented the right logic.
Howver, the query provided does not seem to work. I'm having an issue saying No such column 'CommCare_External_ID__c' on entity 'Person__c'
.
Can you advise on the right query and I could replace it on the job. Otherwise, everything is mapped as supposed to.
@lakhassane Instead of CommCare_External_ID__c
please use Participant_Identification_Number_PID__c
@daissatou2 corrected it and the mapping is correct now
Background, context, and business value
See #3 for project background.
Update the
Upsert Home Visit Log Form
job to link Home Visits to Events using the participant case id (form.case.@case_id
) if the event name (form.basic_information.intervention_hidden
) is not in the form.The specific request, in as few words as possible
If the event name (
form.basic_information.intervention_hidden
) is defined in state, keep the mapping as is below. https://github.com/OpenFn/grassroot-soccer/blob/98f32957ab806e854a59e3226550bfa52746c216/jobs/upsertHomeVisitLog.js#L7If the event name (
form.basic_information.intervention_hidden
) is NOT in the form, then use Person case_id (form.case.@case_id
) to findeventid
to return the mapping below...In this scenario, to find
eventid
we should...Attendance__c
record for that Person. Then seteventid == response[0].Event__c
and output the mapping...state.json
https://www.openfn.org/projects/pd3yk4/messages/mz73ek3b
expression.js
https://github.com/OpenFn/grassroot-soccer/blob/master/jobs/upsertHomeVisitLog.js#L7
output.json
Rerun this transaction: https://www.openfn.org/projects/pd3yk4/runs/rn5j5np3 Field mapping should either be as follows, if
intervention_hidden
is defined...OR as follows if
intervention_hidden
is not defined and we have to go find the Event__c id.