Announcement

Collapse
No announcement yet.

Dreaded TypeError: Cannot read property "xname variable" from undefined

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Dreaded TypeError: Cannot read property "xname variable" from undefined

    I have a JSON object shown below. I'm trying to capture the ID and value in the highlighted in bold custom fields section for use in a filtering rule in a later destination. I'm using the drag and drop mapping from the inbound template for the custom field id and custom field value. I put that in an iterator, but always get this error. How do I load an array of the custom field values in the JSON?

    {
    "patients" : [
    {
    "racename" : "Other Race",
    "email" : "[email protected]",
    "departmentid" : "169",
    "homephone" : "3333333333",
    "guarantorstate" : "MA",
    "homebound" : false,
    "ethnicitycode" : "2186-5",
    "contactpreference" : "HOMEPHONE",
    "confidentialitycode" : "N",
    "guarantordob" : "10/06/1998",
    "zip" : "01430",
    "guarantoraddresssameaspatient" : true,
    "portaltermsonfile" : false,
    "status" : "active",
    "lastname" : "Fudd",
    "guarantorfirstname" : "Elmer",
    "city" : "ASHBURNHAM",
    "povertylevelincomedeclined" : false,
    "guarantoremail" : "[email protected]",
    "guarantorcity" : "ASHBURNHAM",
    "guarantorzip" : "01430",
    "sex" : "M",
    "privacyinformationverified" : true,
    "primarydepartmentid" : "169",
    "emailexists" : true,
    "race" : [
    "2131-1"
    ],
    "language6392code" : "eng",
    "primaryproviderid" : "67",
    "consenttocall" : true,
    "mobilephone" : "3333333333",
    "smsoptindate" : "10/01/2021",
    "hasmobile" : true,
    "registrationdate" : "10/01/2021",
    "guarantorlastname" : "Fudd",
    "firstname" : "Elmer",
    "guarantorcountrycode" : "USA",
    "racecode" : "R9",
    "state" : "MA",
    "patientid" : "26245",
    "dob" : "10/06/1998",
    "customfields" : [
    {
    "customfieldid" : "741",
    "customfieldvalue" : "HUNTERS INC"
    },
    {
    "customfieldid" : "863",
    "customfieldvalue" : "enrolled",
    "optionid" : "203"
    }
    ],
    "guarantorrelationshiptopatient" : "1",
    "address1" : "100 S Main St",
    "guarantorphone" : "3333333333",
    "povertylevelfamilysizedeclined" : false,
    "maritalstatus" : "U",
    "countrycode" : "USA",
    "guarantoraddress1" : "100 S Main St",
    "maritalstatusname" : "UNKNOWN",
    "consenttotext" : true,
    "countrycode3166" : "US",
    "guarantorcountrycode3166" : "US"
    }
    ],
    "totalcount" : 1
    }
    Attached Files

  • #2
    I don't use the iterator function.

    Just use javascript array prototype functions on those JSON blobs, like .find and .filter.


    Diridium Technologies, Inc.
    https://diridium.com

    Comment

    Working...
    X