Can't retrieve custom fields through contactservice.load c#

I’m writing a c# application, and I’m attempting to use the EventDay .net library for infusionsoft GitHub - EventDay/Infusionsoft.net: A C# Wrapper around the Infusionsoft.com API

I’m not tied to it if I can figure out a different way. My problem is that the library works fine for retrieving the native fields such as Email, Id, etc. But does not pull in any custom fields. Here’s a sample of what I’m dealing with.

Contact contact = client.ContactService.Load(infusionsoftid, new string { “Email”,“Id”,“_CustomerNumber”},);

That code will pull in the email and ID fine, but pulls back nothing for our custom field “_CustomerNumber”.

Any help would be much appreciated.

From what you are describing this might be a problem with what information is in the contact’s record. Let me explain. When a call is made to get a record it will only return fields that have a value. If the contact record that is being returned doesn’t have a value for customer number then the field won’t be returned as null.

Hi, thanks for responding!

Sorry I should have mentioned that I am specifically testing for records that do have a value for _CustomerNumber. I verify this by going to the infusionsoft website, looking up the contact, and viewing the record. I then plug the id for that contact into my test scenario.

Alright, If a contact with this number is used then is the Customer Number returned through the API as it should be?

No, and therein lies the problem. When I do the call, standard infusionsoft fields that are called the same way are populated. ie: Email etc.

The call generates no error, so it seems to recognize the custom field name, but no value is ever returned for that custom field.

I should also mention that I’ve created an issue on the github page for the EventDay infusionsoft library here.

Though, looking at other issues, they don’t seem to responsive.

The issue appears to be with the third-party C# SDK, which we don’t internally support.

Yep, I realize that infusionsoft doesn’t directly support this library. I was hoping someone in here had used and had the same issues possibly. Looking for a workaround.

Without seeing the code that the C# SDK uses It will difficult to help. I will pull it down and take a look.

I wound up rolling my own solution that uses the REST service. I wouldn’t bother unless you’re wanting to help someone that might have the same issue in the future :slight_smile: