I have a form that works fine, but when I attempt to access an attribute from the resulting JSON document, I get the error TypeError: Cannot read property 'fields' of null
I am using the Utils.getField(report, 'visit_verification.missed_appointment')
function, see examples on this page and my resulting JSON is as follows:
{
form: 'visit_verification',
type: 'data_record',
content_type: 'xml',
reported_date: 1656237028034,
fields: {
inputs: {
meta: [Object],
source: 'task',
source_id: 'e95ef8ab-8adb-4e82-a215-d2bfa1846dbd',
t_patient_id: 'patient_id',
t_patient_name: 'Patient Name',
t_patient_sex: '',
t_chw_name: '',
t_chw_phone: '',
t_patient_age_in_years: '4',
t_patient_age_in_months: '59',
t_patient_age_in_days: '',
t_patient_age_display: '',
t_supervisor_phone: '+17782473214',
t_medic_patient_id: 'patient_id',
t_missed_appointment_date: '',
t_trace_reasons: '',
t_emr_id: '',
contact: [Object]
},
source: 'task',
source_id: 'e95ef8ab-8adb-4e82-a215-d2bfa1846dbd',
patient_uuid: 'patient_id',
dob: '2017-07-09',
geolocation: '',
patient_age_in_years: '4',
patient_age_in_months: '59',
patient_age_in_days: '1813',
patient_age_display: '4 years and 11 months old',
patient_id: 'patient_id',
patient_name: 'Patient Name',
patient_name_display: 'Patient Name',
patient_sex: 'female',
chw_name: '',
chw_phone: '',
missed_appointment_date: '',
trace_reasons: '',
emr_id: '',
needs_signoff: 'true',
supervisor_phone: '+17782473214',
visit_verification: {
n_patient_name: '',
n_patient_emr_id: '',
n_trace_reason: '',
n_missed_appointment_date: '',
missed_appointment: 'yes'
},
meta: { instanceID: 'uuid:de25e446-20c3-4445-baaf-d7fcb43152ce' },
trace_report_date: '2022-06-24'
},
_id: '5d68e0a5-8453-4787-87ff-7bdc3e16d9e5',
_rev: '1-949aa69921f0fcb1a716cd666e8bbbec'
}
What could I be possibly missing?