OpenFn / grassroot-soccer

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

Map case data from Skillz Plus Club Register Participants form to Salesforce #15

Closed taylordowns2000 closed 3 years ago

taylordowns2000 commented 3 years ago

@daissatou2 , @aleksa-krolls , the general form has a structure like this inside state.data.form:

"question1": [
      {
        "age_group": "15 - 19",
        "case": {
          "@case_id": "f9d6ee04-0757-4c21-a8c5-9a068d11c2e2",
          ...

And once inside the question1 array, we attempt to access @case_id via state.data.case['@case_id']. :heavy_check_mark:

The structure of a skill plus club form, however, is like this:

 "new_participants": [
      {
        "age_in_years": "6",
        "create_skillz_plus_participant": {
          "case": {
            "@case_id": "76488ed2-3d1d-44e8-9a06-3e012f438282",
            ...
          },
        },
        "get_coaches_for_skillz_plus_club": {
          "coach_id": "b60c85118ca24a9d951256184b379f6d",
          "create_spc_participant_delegate": {
            "case": {
              "@case_id": "1d42a8ea-2420-4b33-b693-a40ee462f991",
              ...

So once inside the question1 array, attempting to access @case_id via state.data.case['@case_id'] fails. :x:

I'm guessing that we should follow this create_skillz_plus_participant path and use the @case_id we find in there, but will await your instructions!

aleksa-krolls commented 3 years ago

@taylordowns2000 yes, that is correct. See my comment here and please follow the path create_skillz_plus_participant for the Skillz club plus form.

@daissatou2 when Taylor has made this change and you're testing, consider if this path create_skillz_plus_participant should be added to the other questions as well (if you haven't already)

taylordowns2000 commented 3 years ago

Addressed in above commit. See https://www.openfn.org/projects/pd3yk4/runs/r3xmjj84