OpenFn / lwala

2 stars 3 forks source link

Bulk upsert person visits: TypeError [Error]: Cannot read properties of undefined (reading 'filter') #105

Closed daissatou2 closed 1 year ago

daissatou2 commented 1 year ago

Background

See issue #91 . This is related to the bulk workflow for Person Visits

Issue

TypeError [Error]: Cannot read properties of undefined (reading 'filter') https://www.openfn.org/projects/staging-lwala-chw-support/runs/06450efd-fadd-7c68-a76d-0c72181c6ae8

What is the unexpected input? Why is there a TypeError?

expression

Please work on the bulk-testing branch!! https://github.com/OpenFn/lwala/blob/bulk-testing/commcare-salesforce-jobs/test_jobs/TEST_upsert_person_and_person_visit.js

state

Run Job 1 (https://github.com/OpenFn/lwala/blob/bulk-testing/bulk/getCases-PersonVisits.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 Visit record to Salesforce.