GravityForms to Salesforce API, problem with people who leave out company [closed]

First thought is – why not make Company be required?

If that’s not acceptable, there should be a way. I’ve not used this API, but have used other Gravity Forms hooks. Assuming you can hook in before it talks to the API, you should be able to check for the absence of one field, and replace it’s value with that of another.

Example… bear in mind this is taken from another API for Gravity Forms.

add_filter('gform_pre_submission_1', 'user3515_function');
function user3515_function($form){
    $field_we_are_checking = 'input_77';
    $name = $_POST['input_3'].' '.$entry['input_4'];

    if(empty($_POST[$field_we_are_checking])){
        $_POST[$field_we_are_checking] = $name;
    }
    return;
}

EDITED

You’ll obviously want to utilize the correct hook for your filter. gform_pre_submission should be good, you’ll have to test. You’ll also need to supply the correct field names for company and name. You can learn those by looking at a completed result in phpmyadmin under gforms… lead detail I believe. Otherwise inspect in Chrome and it should tell you what field numbers each is.

Good luck, let me know if this gets you in the right direction.