Closed aleksa-krolls closed 3 years ago
@taylordowns2000 I think this will be a quick one since I already drafted the job... do you or Elias have time today to help me out to unblock testing? (It can wait until tomorrow, if not... maybe backlog will clear out.)
@aleksa-krolls I'd love to help on this. Maybe we can setup some time in the afternoon today to work on this ?
@elias-ba , could you go for it now?
i'm tied up until noon BST, but you can spin this up locally and try to solve without making commits to main
. @lakhassane could give a quick pointer here and there if necessary
Yes @taylordowns2000 I can. I just need 30 minutes to finish my work on #1402 and I jump on this one. @lakhassane (or @aleksa-krolls) do you think you can have 10 minutes to give me more context / Knowledge on this in a quick call ?
Hey @aleksa-krolls, this seems to be working fine locally now. In order for it to work we had to modify the language-commcare adapter to see this commit that I made ? We may be blocked because I cannot release a new version of the language-commcare adaptor and @taylordowns2000 and @lakhassane are currently unavailable.
@elias-ba , I've released the adaptor version (v1.3.0
) and tested this on prod. All green checks, but I do not see the expected results when validating in the CommCare app.
Possible that the job code is only accounting for one of the two shapes of data that @aleksa-krolls requires? See my last run for each of these different looking messages:
Thanks @taylordowns2000. What are these two records at 0705 ?
@elias-ba , are you online but not on Slack? Was trying to chat you there before. Please ping me there if you're around and want to work on this.
(The records are the result of the successful runs that I linked to.)
Hey @aleksa-krolls this is all-good now. I have tested locally and in prod. Everything works as expected. Can you give it a test and lemme know ?
thanks @elias-ba , working well! Will keep you posted if anything else comes up.
Background
Lwala is using Salesforce to auto-generated Household codes it assigns to each new record. We want OpenFn to sync this
Household Code
back to CommCare to overwrite the CommCare casename
to match this code.Request
I've already draft a job that does this using the CommCare Bulk XLS Import API (see CommCaredocs). However, I need help updating the job to handle 2 different versions of state.
Sometimes Salesforce sends us webhook notifications with the data in an object
"Notification": {...}
https://www.openfn.org/projects/pdbmj5/messages/06151ffd-989f-76cc-a70d-b4feb3ba5bc3Sometimes the data comes in an array
"Notification": [...]
... so we'll probably need to implementeach(...)
here and build an XLS with several rows to submit to CommCare: https://www.openfn.org/projects/pdbmj5/messages/06151feb-91fa-7972-bc9e-65030bfbde5eadaptor
commcare see the job on prod: https://www.openfn.org/projects/pdbmj5/jobs/jvendk
expression
https://github.com/OpenFn/lwala/blob/b2e860fc818ba6a2e1dd2b6a8a9cc638f9fb5ce3/salesforce-commcare-jobs/Update-HH-Name.js#L7
state
See LP for
OpenFn CommCareHQ (Lwala)
See message links above... feel free to test both on prod.Testing notes
You can validate the success of these imports via this CommCare page: https://www.commcarehq.org/a/lwala-community-alliance/data/edit/import_cases/ For every message sync, you should see that
N cases were matched and updated.