/**
* Gravity Perks // Copy Cat // Copy as Comma-delimited List
* https://gravitywiz.com/documentation/gravity-forms-copy-cat/
*
* When copying multiple values to a single input, Copy Cat will join
*
* Instructions:
*
* 1. Install this snippet with our free Custom JavaScript plugin.
* https://gravitywiz.com/gravity-forms-code-chest/
*
* 2. Configure the snippet per the inline instructions.
*/
gform.addFilter( 'gppc_copied_value', function( value, $elem, data, sourceValues ) {
// Update "4" to ID of the field that should be populated with commma-delimited values.
if ( data.target == 4 ) {
value = sourceValues.join( ', ' );
}
return value;
} );
This snippet cannot handle a text that contains “xxx”. For example, I have a list field where the option I want to copy to another field looks like this: • John “Brett” S.
Help is appreciated.
Hey,
I just gave this a quick test locally, but it appears to be working okay for me when copying from a List field to a Single Line Text field. I’ll follow up with you via Support so we can understand your setup a little better and see why this isn’t working.