Closed daissatou2 closed 3 years ago
@daissatou2 Pls note my feedback....
intervention_name
is provided in this state... so we need to look-up this name using the case_id, which is available to us.item[*]
array)? If yes, please provide another example of that state and specify on this issue that the job needs to work for both versions of state. This is ready for implementation.
@taylordowns2000 This grs issue is ready. Let me and @daissatou2 know if you have questions.
Sounds good. I'm shutting down for now and didn't get to this, but @chaiwa-berian is back online in the morning so I'm re-assigning to him.
@aleksa-krolls @daissatou2 Is the Skills plus club attendance form
a section of the Attendance form
in CommCare?
@daissatou2 What's going on with this one? Were you able to resolve Chaiwa's questions? This morning please test to provide feedback or close this issue if resolved - thanks!
@chaiwa-berian is this job in production? I can't find on Github.
@chaiwa-berian What's the status of this one here? Still in progress? I'm moving to the top of the backlog in case there is still work to be done.
cc @taylordowns2000 @daissatou2
@aleksa-krolls The job is linked and ready for testing. Getting this error but it should be quick to fix by you or @daissatou2 .
INVALID_FIELD: Foreign key external ID: dd621bb8-af17-4393-bcc2-ddba4d499750 not found for field Participant_Identification_Number_PID__c in entity Person__c
Background, context, and business value
The
Attendance
form forSkillz Plus Clubs
does not send us the session name or number. The job should decide which session to map attendance to by checking which is the earliest session that isnull
.The specific request, in as few words as possible
When uploading this form data, for each
form.attendance_list.update_participant_cases.item[*]
...Query
Event__c
to search for theevent_name
to build the Attendance external Id. Use what we implemented in this other [Attendance job]... https://github.com/OpenFn/grassroot-soccer/blob/de74a730a6a3da1ca3a389b041ce27b601704235/jobs/upsertAttendance.js#L1-L5Use the
event_name
returned to set theCommCare_Ext_ID__c
in the next step...Query for the existing
Attendance
record to check if theSession_X__c
fields (Session 1-28) have been completed... then fill in whichever field isnull
and has not yet been completed.Session_1__c===null
... if true, mapitem[*].create_attendance_case.case.update.skillz_plus_attendance
to this field using this logic to set the SF Session field:...If false, check the next field
Session_2__c===null
. If true, map...skillz_plus_attendance
to this field. If false, check the next fieldSession_3__c
...and so on.Ex. The first time attendance is taken for a user we'll check if
Session_1__c
isnull
. It will benull
so we map toSession_1__c
. The second time, we'll check ifSession_1__c
isnull
. It will not be null so we'll check ifSession_2__c
isnull
. It will benull
so we'll map attendance toSession_2__c
. This will happen up toSession_28__c
.This job should also be able to handle multiple attendance entries like the general Attendance job. It should also be able to handle one attendance entry as well as many, see example state files below.
The mappings for the Skillz Plus Club Attendance form are here.
state.json
See LP for
GRS Salesforce Sandbox
https://www.openfn.org/projects/pd3yk4/messages/mpq5vbnd - Attendance for multiple participants https://www.openfn.org/projects/pd3yk4/messages/mrbp4azj - Attendance for one participant Please run against these states in prod to test.trigger
Attendance Skillz Plus Club
expression.js
New job you can link to prod here: https://www.openfn.org/projects/pd3yk4/jobs/jv4enr