• Resolved luxworx

    (@luxworx)


    Hello,
    Thank you for this great plugin.
    The issue I have is that people submitting the form enter phone number with coutry code with a + sign.
    When a + sign is at the beginning of the string google sheets report it as en error.
    Is there a way to add a string to my saved data, so there will be for example “Phone: & “submitted data with + sign”.
    O what would be some other solution to solve this problem?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author westerndeal

    (@westerndeal)

    Hi @luxworx,

    Thank you for using our plugin.

    We are coming up with an addition of a hook for the users to have 3rd party values to the Sheet.

    To save the phone number with the + sign you can use that hook “gsc_filter_form_data”, add the custom code, and return the values.
    But this will add ‘ sign in front of the phone number in the sheet.

    We will add an example for implementation here once we release the new version. So stay tuned.

    Thanks
    Abdullah

    Thread Starter luxworx

    (@luxworx)

    So is this hook ‘gsc_filter_form_data’ available now or I should wait for the next release?

    Plugin Author westerndeal

    (@westerndeal)

    @luxworx,

    The hook will be available in an upcoming release.

    We will be releasing it by the weekend.

    Thanks
    Abdullah

    Plugin Author westerndeal

    (@westerndeal)

    @luxworx,

    We have just released the plugin. Take the latest and implement the hook as per the below example

    add_filter( “gsc_filter_form_data”, “customized_phone_number”, 10, 2 );

    function customized_phone_number( $data, $form ) {
    // Condition to just apply custom code for a particular contact form id.
    if( $form->id() == 5 ) {
    // tel-833 is the form field name.
    $original_value = $data[‘tel-833’];
    unset( $data[‘tel-833’] );
    // Set with new value
    $data[‘tel-833’] = “‘{$original_value}”;
    return $data;
    }
    return $data;
    }

    Add this code to your active themes functions.php file or create a custom plugin.

    Hope this helps. Let us know.

    Thanks
    Abdullah

    Thread Starter luxworx

    (@luxworx)

    Works perfectly,
    Thank you for your excellent support!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add a string to saved data’ is closed to new replies.