OpenFn / grassroot-soccer

Grassroot Soccer CommCare-Salesforce integrations
https://openfn.github.io/grassroot-soccer/
0 stars 0 forks source link

Update the `Attendance Non Skillz` job to NOT sync any data if no participant attendance data is provided #40

Closed daissatou2 closed 2 years ago

daissatou2 commented 2 years ago

Background, context, and business value

We have been seeing Attendance Non Skillz messages in the OpenFn inbox that do not have any participant data. These are currently causing the job to fail.

The specific request, in as few words as possible

Update the Attendance Non Skillz job to NOT sync any data if no participant attendance data is provided in the message. If state.data.form.attendance_list.update_participant_cases.item[] is missing from the message, instead of attempting to sync data to Salesforce, the job should end(pass) and log the message "No participant attendance data was provided".

state.json

{
  "configuration": ["SEE LAST PASS: 'GRS Salesforce Sandbox'"],
  "data": https://www.openfn.org/projects/grs-integrations/messages/0632996e-f7c3-7e69-9c3b-3b44c69a1f96
}

adaptor

language-salesforce

trigger

Attendance Generic (Both Skillz & Non Skillz) trigger on platform

expression.js

https://github.com/OpenFn/grassroot-soccer/blob/master/jobs/upsertAttendanceNonSkillz.js

ritazagoni commented 2 years ago

hey @daissatou2 this is ready to test