novaksolutions/infusionsoft-php-sdk

Extracting custom fields of the contact

Closed this issue · 0 comments

Hi,

I'm trying to extract some contact information which is under custom fields. So lets say few contacts have _CustomField1 with value 'Test Value'.

 $returnFields = array(
     'Id',
     'FirstName',
     'LastName',
     '_CustomField1'
);
$Contacts= Infusionsoft_DataService::query(new Infusionsoft_Contact(), array('_CustomField1' => 'Test Value'), 1000, 0, $returnFields);
var_dump($Contacts);

This way i receive correct contacts with those return fields visible under [data:protected] field.

(
    [0] => Infusionsoft_Contact Object
        (
            [customFieldFormId] => -1
            [fields:protected] => 
            [table:protected] => Contact
            [data:protected] => Array
                (
                    [Id] => 15634
                    [FirstName] => Lesley
                    [LastName] => MacTavish
                    [_CustomField1] => Test Value
                )

            [appPoolAppKey:protected] => myXXX.infusionsoft.com
        )
)

Now im able to extract any of standard fields using $Contacts[0]->Id or $Contacts[0]->FirstName,
but its not returning me value if i access custom field: $Contacts[0]->_CustomField1

Please suggest how can i achieve that