• Resolved quikned

    (@quikned)


    I have a form for Sprout estimate requests.

    Many of these forms are submitted by individuals (not Companies/Businesses).

    I have fields for
    FIRST NAME
    LAST NAME
    COMPANY
    and more…

    Obviously an individual will leave the COMPANY field blank.

    However your plugin mapping doesn’t allow for any flexibility with blank fields. Your client mapping wants me to map the COMPANY field… so obviously I mapped it to the COMPANY field that I created in the Gravity Form.

    You use that COMPANY field to then create/populate the COMPANY field for the client.

    The COMPANY value then displays in the Sprout Estimates section under the “client” section.

    Unfortunately, if the COMPANY field is left blank (as it would be for an individual) then it appears as “blank” in the Sprout Estimates section under the client area.

    We need a “fallback” value for COMPANY if it is left blank… or an option to use a secondary field… such as FIRST NAME LAST NAME.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Elana Davis

    (@elanasparkle)

    Hello @quikned,

    ?Thank you for reaching out to support! We have a hook that can do this for you if you see below. If you take the FormID of your gravity form and replace that in the hook below. You can see that FormID from the main Gravity Forms page. Then if you want to set it to a different field below you can but this field would if the client is blank then set it to the first name.

    To add a hook you can use a plugin called snippet or you can put this in your active themes functions.php file. By going into your WordPress admin and going to Appearance -> Theme Editor and clicking on theme functions on the right and adding it past the <?php part in that file.

    function maybe_modify_gravity_forms_company_name( SI_Client $client,  $submission = array(), $entry = array(), $form = array(), $doc_id = 0 ) {
    	// Only a specific form do this process
     	$form_id_to_process = 1; // change
    	if ( $entry['form_id'] != $form_id_to_process ) {
    		return;
    	} 
     
    	$client_name = $submission['client_name'];
    	$first_name = $submission['user_first_name'];
    
    	if($client_name == ''){
    		$client->set_title($first_name);
    	}
    
    }
    add_action( 'si_gravity_forms_integration_client_created',  'maybe_modify_gravity_forms_company_name', 10, 10 );
    Plugin Support Elana Davis

    (@elanasparkle)

    Hello @quikned,

    I’m going to mark this as resolved. Please don’t hesitate to reach out if you are still running into issues.

    Thanks
    Elana D.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Client Company vs Name on Gravity Form and Client Creation’ is closed to new replies.