I have an optional textbox field in my webform. When a user first fills the form with some data(for the optional field) it gets merged with mailchimp fields. but when the user fills the form again with blank optional field, the original data for that optional field in mailchimp is lost.

Comments

TechNikh’s picture

Status: Active » Closed (fixed)

fixed it by below code

// This is probably a bit to easy... The delta value is not taken into account
if(!empty($submission->data[$key]['value'][0])){
	$mergefields_replacements[$mergefields_key_array[$field['form_key']]] = $submission->data[$key]['value'][0];
}