cancel
Showing results for 
Search instead for 
Did you mean: 

API: Problem: Upload Contacts Bulk Activity containing a comma

Highlighted
Occasional Contributor

API: Problem: Upload Contacts Bulk Activity containing a comma

Hello,

 

I am facing the following issue.

When the JSON payload contains a comma in the value of a custom field, the imported contact is not correct.

For example:

The import of the following

 

Custom Field 1: test, test

Custom Field 2: value 2

Custom Field 3: value 3

 

Has the following result in Constant Contact:

Custom Field 1: test

Custom Field 2: test

Custom Field 3: value 2

Custom Field 4: value 3

 

I believe this is not by design, but perhaps I need to escape the comma someway? However I do not understand this, because the field's value is wrapped between double quotes in the JSON string.

 

Can anyone shed some light on this?

3 REPLIES 3
Regular Advisor

Re: API: Problem: Upload Contacts Bulk Activity containing a comma

Hello,

 

Thanks for posting.  What your experiencing definitely seems like a defect in the processing of the custom fields.  Would you mind sending me a PM with the details of the API call?  Thanks.

 

Andrew B.

Constant Contact

API Support

Highlighted
Occasional Contributor

Re: API: Problem: Upload Contacts Bulk Activity containing a comma

Thanks for your reply Andrew. I have sent you a JSON string via PM.

Highlighted
Regular Advisor

Re: API: Problem: Upload Contacts Bulk Activity containing a comma

Here's an update.  We have been able to reproduce the problem and it is logged as a defect to be fixed.  We were also able to determine a workaround until the fix is live.  If there is a custom field with a comma in the value, you can wrap the field in escaped double quotes to ensure correct processing. 

 

So this:

 

{
     "name":"Custom Field 1",

     "value":"test, test"

}

 

Becomes this:

 

{
     "name":"Custom Field 1",

     "value":"\"test, test\""

}

 

I'll provide another update once I know when the fix should be released.