Bulk upsert Person - Handle undefined locations TypeError [Error]: Cannot read properties of undefined (reading 'catchment')
Closed this issue · 3 comments
Background
See issue #90 . This is related to the bulk workflow for Person
s
Issue
See run failure for Job 2 with error TypeError [Error]: Cannot read properties of undefined (reading 'catchment')
https://www.openfn.org/projects/staging-lwala-chw-support/runs/064510c9-e8c0-7a91-8ce1-46a353593bdc
I think this is because a catchment
ID is not found. If this is the case, then please return the id 'a00G5000003IFLUIA4'
as the value for catchment
if a matching location cannot be found or if CommCare owner_id
is blank.
expression
Please work on the bulk-testing
branch!!
https://github.com/OpenFn/lwala/blob/bulk-testing/commcare-salesforce-jobs/Upsert-Person-Case-Update.js
state
Run Job 1 (https://github.com/OpenFn/lwala/blob/bulk-testing/bulk/getCases-Person.js) to generate state for Job 2...
Job 1:
configuration: SEE LP OpenFn CommCareHQ (Lwala) - PROD
data: {}
Job 2:
configuration: see LP Lwala Salesforce Sandbox (Bulk 2023)
data: use the final state from job 1
output
If Job 1 gets 0
records from CommCare, then no action should happen in Job 2.
If Job 1 gets >0
records from CommCare, then sync each item as a Person record to Salesforce.
@mtuchi another issue from testing on platform. @daissatou2 will support with testing once you take a look.
@aleksa-krolls this is fixed on #108
Thank you, looking good @mtuchi !