I am trying to use the checkbox on my sign up form to allow users to pick between 4 options. After the options are selected, pass the results to our ZohoCRM and map it to a multi-line field (originally, I want to map it to a pick list but this is not supported by gravity form, which is a shame and my only choice is the multi-line field).
Once the data goes into my multi-line field, it looks like this:
["Option1","Option2","Option3"]
Unfortunately, ZohoCRM doesn’t like this format and it causes issue with all of our workflows and blueprint.
I need gravity form to replace the comma separator with a pipe so that it looks like this:
["Option1"|"Option2"|"Option3"]
I tried the steps on this page & replace activecampaign with zohocrm:
Added it to my functions.php:
add_filter( 'gform_zohocrm_field_value', 'gf_replace_commas_with_pipes', 10, 4 );
function gf_replace_commas_with_pipes( $value, $form, $entry, $field_id ) {
$field = GFAPI::get_field( $form, $field_id );
if ( is_object( $field ) && ( $field->type == 'checkbox' || $field->type == 'multiselect' ) ) {
$value = str_replace( ', ', '||', $value );
}
return $value;
But when the data reaches zohocrm, it’s still a comma: https://jmp.sh/mWLV0Jb
The comma is causing issues with my zohocrm workflow and I need the separator in pipe instead.
Thanks!