OpenFn / grassroot-soccer

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

GRS CommCare to Salesforce #2

Closed hnyende closed 3 years ago

hnyende commented 3 years ago

Background, context, and business value

See issue #1 for an overview and the data flow.

The specific request, in as few words as possible

See here for the mapping sheet.

Create the following jobs that execute the following steps: Extract forms from CommCare

  1. GET the following form data from CommCare: Pre Challenges Post Challenges Register Event Service Referral Followup Service Referral Aggregate Service Referrals Register Skills Plus Club ART Adherence Self-Reporting Tool

See CommCare API docs and this example GET job that contains the xmnls ids: https://www.openfn.org/projects/pd3yk4/jobs/jvebnp We want to extend this job to send 1 GET request for every form.

Map CommCare forms to Salesforce

  1. Upsert Pre Challenges in Salesforce. The job should upsert the attendance object using Intervention Name and Participant Name as the unique identifier.
  2. Upsert Post Challenges in Salesforce. The job should upsert the attendance object using Intervention Name and Participant Name as the unique identifier.
  3. Upsert Register Event in Salesforce. This job should upsert Event records using Event Name as the unique identifier.
  4. Upsert Service Referral Followup in Salesforce. This job should upsert NewReferral records using Intervention Name and Participant Name as the unique identifier.
  5. Upsert Service Referral in Salesforce. This job should upsert NewReferral records using id as the unique identifier.
  6. Upsert Aggregate Service Referrals in Salesforce. This job should upsert NewReferral records using id as the unique identifier.
  7. Upsert Register Skills Plus Club in Salesforce. This job should upsert Event records using Name as the unique identifier.
  8. Upsert ART Adherence Self-Reporting Tool in Salesforce. This job should upsert ART Adherence Self-Reporting Tools records using This job should upsert NewReferral records using id as the unique identifier.

state.json Salesforce creds: See LP GRS Salesforce Sandbox CommCare creds: See LP GRS CommCare App

Project Inbox: See links to sample CommCare JSON responses in google sheet - see Forms Objects sheet for the high-level entity mappings, and links to state Messages.

adaptor CommCare or HTTP adaptor to get? Salesforce adaptor to load

trigger Job 1 which fetches form data will be timer-based. Confirming with GRS team on the frequency of the sync... The upsert jobs will be message filter-based (e.g., {"form": { "@name": "Pre Challenges"}}

expression.js 9 jobs...

1 to get all form data, other 8 to upsert to corresponding Salesforce object.

aleksa-krolls commented 3 years ago

@chaiwa-berian please note @hnyende Slack comment re: new version of state for upsertServiceReferralFollowup: https://www.openfn.org/projects/pd3yk4/messages/mn5e37pb

Then, when you are done drafting v1 of these jobs and don't need additional answers to finish the initial setup... please move this issue to the Review column of the board. Thank you!

chaiwa-berian commented 3 years ago

@aleksa-krolls noted, but I would wait for @hnyende or @daissatou2 to update the details in this and this column then I will make updates to upsertServiceReferralFollowup. As it stands, it is difficult to figure out the mapping just from the sample data. Thanks!