Update multi option select

Hi Folks

I was wondering if there was a way to update a multi option select without clearing out the curretly selected options. I am able to unselect a specific item using the clear flag but when I try to select another option it clears all of the options that were previously selected. I would like the field to retain the currently selected options when I select another option to add. I'm using the PHP wrapper for the api.

Thanks!

ChrisB ChrisB, 2 years ago

Hi Mercatus!

Are you running your update with the Clear parameter set to true? If so, that would be the issue. The Update Subscriber details describe what happens to values for a multi-option custom field that are not included in the array:

"Any missing values will remain unchanged. Multi-Valued Select Many custom fields are set by providing multiple Custom Field array items with the same key."

See that here: http://www.campaignmonitor.com/api/subscribers/#updating_a_subscriber. And feel free to post your code here as well!

Mercatus, 2 years ago

Hi Chris

Thanks for the response. No, I am not running my update with the clear parameter set to true. Heres a snippet of the json I am using for the field update -

a:2:{i:0;a:3:{s:3:"Key";s:9:"Interests";s:5:"Value";s:10:"E-Circular";s:5:"Clear";b:0;}i:1;a:2:{s:3:"Key";s:5:"diff_key";s:5:"Value";s:42:"some text here";}}

So according to the documentation, this should add the "E-Circular" option to the Interests field without clearing the currently selected options but it seems to be clearing them out.

Any thoughts?

Mercatus, 2 years ago

I've tried this with php wrapper v3.1 pointing to api v3 and wrapper v4.0 pointing to api v3.1 and had no luck.

Join 200,000 companies around the world that use Campaign Monitor to run email marketing campaigns that deliver results for their business.

Get started for free
1-888-533-8098