We all started somewhere! Share your experience on the Get Advice: Let's Get Started Sweepstakes thread and be entered to win a $100 credit on your Constant Contact account.

Custom Fields in Contacts

AshwinY
Member

Custom Fields in Contacts

Hi,

    Using bulkUrlEncoded method we are uploading multiple contacts with custom fileds. I Have a situation where my custom fileds are not getting updated in the existing contacts nor getting inserted with new contacts.  Previously it used to work well, but now its not working. I haven't made any changes to my code. 

7 REPLIES 7
BPAA
Participant

 

 

I have the same problem, I hope someone fix it soon.

EBSHealthcare
Regular Participant

Hello,

 

I want to start by apologizing for the delay in getting some information out on this issue. We are aware of this issue and have been coordinating with the development team for our contact management tools to find and resolve this issue. We are currently doing testing on our solution and should have it available in an update soon.

 

If there are any questions about this, please feel free to reply to this thread and we will be happy to answer!

 

Best Regards,

Elijah G.
API Support Engineer

Is this issue Resolved???? Still my custom fields are not getting updated...

 

Is there an equivalent in api v2 for  v1 BulkUrlEncoded ?

Hello,

 

We have recently released an update that was intended to address this issue directly. If you are still experiencing problems with your custom fields not importing, it would be ideal if you could send us an email at webservices@constantcontact.com with some of the following information:

 

Constant Contact username that is being uploaded to

Body of the bulk upload being sent

Name of list(s) used

Date and time upload was sent

 

I will be happy to look into this for you so that we can determine the issue and correct it as quickly as possible.

 

Sincerely,

Elijah G.
API Support Engineer
Rajgauravj
Regular Participant

Hi all,

 

Below code is working fine for me, i am able to update custom field of contacts in constant contact.

 

 

 

private Contact AddContactToConstantContact(CustomerDTO doctor)
{
Contact contact = GetContactByEmailAddress(doctor.EmailAddress.Trim());

if (contact == null)
{
contact = new Contact();
}

contact.Lists.Add(new ContactList() { Id = EditingList.CTCTListId, Status = Status.Active });

//add email_addresses [Required]
var emailAddress = new EmailAddress()
{
Status = Status.Active,
ConfirmStatus = ConfirmStatus.NoConfirmationRequired,
EmailAddr = doctor.EmailAddress
};

contact.FirstName = doctor.FirstName == null ? string.Empty : doctor.FirstName;
contact.LastName = doctor.LastName == null ? string.Empty : doctor.LastName;

contact.WorkPhone = doctor.WorkPhone == null ? string.Empty : doctor.WorkPhone;
contact.HomePhone = doctor.MainPhone == null ? string.Empty : doctor.MainPhone;

contact.CustomFields = new List<CustomField>(contact.CustomFields);

contact.CustomFields.Add(new CustomField() { Value = doctor.AccountNumber != null ? doctor.AccountNumber : "", Name = "CustomField1" });
contact.CustomFields.Add(new CustomField() { Value = doctor.Address1 != null ? doctor.Address1 : "", Name = "CustomField2" });
contact.CustomFields.Add(new CustomField() { Value = doctor.Address2 != null ? doctor.Address2 : "", Name = "CustomField3" });
contact.CustomFields.Add(new CustomField() { Value = doctor.City != null ? doctor.City : "", Name = "CustomField4" });
contact.CustomFields.Add(new CustomField() { Value = doctor.State != null ? doctor.State : "", Name = "CustomField5" });
contact.CustomFields.Add(new CustomField() { Value = doctor.ZipCode != null ? doctor.ZipCode : "", Name = "CustomField6" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PracticeGroupName != null ? doctor.PracticeGroupName : "", Name = "CustomField7" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PracticeName != null ? doctor.PracticeName : "", Name = "CustomField8" });
contact.CustomFields.Add(new CustomField() { Value = doctor.CurrentCharges.ToString(), Name = "CustomField9" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue30.ToString(), Name = "CustomField10" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue60.ToString(), Name = "CustomField11" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue90.ToString(), Name = "CustomField12" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue120.ToString(), Name = "CustomField13" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue150.ToString(), Name = "CustomField14" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue180.ToString(), Name = "CustomField15" });

//update Contact if Id exists in constant contact
if (contact.Id != null)
{
return contact = _constantContact.ConstantContact.UpdateContact(contact, false);
}
else
{
contact.EmailAddresses.Add(emailAddress);
return contact = _constantContact.ConstantContact.AddContact(contact, false);
}
}

 

Thank you

Raj

raj_gaurav@outlook.com

Rajgauravj
Regular Participant

Hi all,

 

Below code is working fine for me, i am able to update custom field of contacts in constant contact.

 

 

 

private Contact AddContactToConstantContact(CustomerDTO doctor)
{
Contact contact = GetContactByEmailAddress(doctor.EmailAddress.Trim());

if (contact == null)
{
contact = new Contact();
}

contact.Lists.Add(new ContactList() { Id = EditingList.CTCTListId, Status = Status.Active });

//add email_addresses [Required]
var emailAddress = new EmailAddress()
{
Status = Status.Active,
ConfirmStatus = ConfirmStatus.NoConfirmationRequired,
EmailAddr = doctor.EmailAddress
};

contact.FirstName = doctor.FirstName == null ? string.Empty : doctor.FirstName;
contact.LastName = doctor.LastName == null ? string.Empty : doctor.LastName;

contact.WorkPhone = doctor.WorkPhone == null ? string.Empty : doctor.WorkPhone;
contact.HomePhone = doctor.MainPhone == null ? string.Empty : doctor.MainPhone;

contact.CustomFields = new List<CustomField>(contact.CustomFields);

contact.CustomFields.Add(new CustomField() { Value = doctor.AccountNumber != null ? doctor.AccountNumber : "", Name = "CustomField1" });
contact.CustomFields.Add(new CustomField() { Value = doctor.Address1 != null ? doctor.Address1 : "", Name = "CustomField2" });
contact.CustomFields.Add(new CustomField() { Value = doctor.Address2 != null ? doctor.Address2 : "", Name = "CustomField3" });
contact.CustomFields.Add(new CustomField() { Value = doctor.City != null ? doctor.City : "", Name = "CustomField4" });
contact.CustomFields.Add(new CustomField() { Value = doctor.State != null ? doctor.State : "", Name = "CustomField5" });
contact.CustomFields.Add(new CustomField() { Value = doctor.ZipCode != null ? doctor.ZipCode : "", Name = "CustomField6" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PracticeGroupName != null ? doctor.PracticeGroupName : "", Name = "CustomField7" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PracticeName != null ? doctor.PracticeName : "", Name = "CustomField8" });
contact.CustomFields.Add(new CustomField() { Value = doctor.CurrentCharges.ToString(), Name = "CustomField9" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue30.ToString(), Name = "CustomField10" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue60.ToString(), Name = "CustomField11" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue90.ToString(), Name = "CustomField12" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue120.ToString(), Name = "CustomField13" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue150.ToString(), Name = "CustomField14" });
contact.CustomFields.Add(new CustomField() { Value = doctor.PastDue180.ToString(), Name = "CustomField15" });

//update Contact if Id exists in constant contact
if (contact.Id != null)
{
return contact = _constantContact.ConstantContact.UpdateContact(contact, false);
}
else
{
contact.EmailAddresses.Add(emailAddress);
return contact = _constantContact.ConstantContact.AddContact(contact, false);
}
}

 

Thank you

Raj

raj_gaurav@outlook.com

Developer Portal

View API documentation, code samples, get your API key.

Visit Page