Support » Plugin: Brilliant Web-to-Lead for Salesforce » Creating new fields that map into your Lead

  • Resolved Simone

    (@simonttz)


    Hi there

    This is a great plugin for importing the basic information, I am able to have their basic info carried over (Name, Address, ETC), however I’m finding it tricky to map newly created fields to their corresponding fields within the lead entry in SF.

    Please see my custom field info:

    http://prntscr.com/hd3lys

    And here is my SF Lead test example:
    http://prntscr.com/hd3mcb

    I first tried to map it into the lower area (1) that did not work, so then tried to map it into a new area at the top (2) But it would not carry over

    Does anyone know how to accomplish this??

    UPDATE: I was able to get it to work using the API Name, but I really need it to be a HIDDEN field. It won’t work this way. How can I pass the Value from the hidden field to the Lead??

    Thank you!!

    -Simon

    • This topic was modified 1 year, 11 months ago by  James Huff.
    • This topic was modified 1 year, 11 months ago by  Simone.
Viewing 14 replies - 1 through 14 (of 14 total)
  • Anyone know? James? 🙂

    Plugin Author Nick Ciske

    (@nickciske)

    1. API Name is required for Salesforce to understand which field you’re referencing (this is in the plugin FAQ).
    2. Hidden fields work like any other field, but need to be enabled and have a value defined to have any effect when a lead is submitted (disabled fields are not sent).

    That’s it.

    • This reply was modified 1 year, 11 months ago by  Nick Ciske.
    Plugin Author Nick Ciske

    (@nickciske)

    If it’s still not working… it may be a pick list or lookup field in Salesforce … so Roofing may not be the value Salesforce is expecting.

    This is covered in the FAQ as well, see: How do I use a lookup field with a picklist field in the plugin?.

    It’s working fine! thank you for your help!

    Another thing are UTM fields.. how can I get it to show a hidden field that picks up the UTM based on what URL the landing page was?

    http://prntscr.com/hggv3o — it just shows up like this in my lead like this:
    http://prntscr.com/hggw41

    How can I get it to show the source based on URL string?

    I can see it in the email: http://prntscr.com/hggwky

    I just want the utm_source to show in salesforce lead.

    thank you

    Simon

    Plugin Author Nick Ciske

    (@nickciske)

    
    // Autofill fields based on thew query string (using Google Analytics tracking variables in this example)
    
    add_filter( 'salesforce_w2l_field_value', 'salesforce_w2l_field_value_querystring_example', 10, 3 );
    
    function salesforce_w2l_field_value_querystring_example( $val, $field, $form ){
    
        $form_id = 1; // form id to act upon
        $field_name = 'source__c'; // API Name of the field you want to autofill
        $qs_var = 'source'; // e.g. ?source=foo
    
        if( $form == $form_id && $field_name == $field ){
            if( isset( $_GET[ $qs_var ] ) ){
                return $_GET[ $qs_var ];
            }
        }
    
        return $val;
    
    }
    

    Woa woa woa!

    Thank you! I am assuming I add this into the functions.php file of my theme or child theme ?

    thank you Nick!

    *Adjusting the commented lines to suit my needs of course..

    FYI i am not using anything GA related, just standard UTM tags in the URL for now.

    thx

    S

    Plugin Author Nick Ciske

    (@nickciske)

    That code works with any query string variable.

    Hi Nick, I appreciate your ongoing help, however i am stuck here. I just want to have these fields show what params were in the URL

    how do I do that? I’m not very technical so you’ll have to excuse me and speak as if I have limited knowledge

    http://prntscr.com/hgjbd5

    ?utm_source=testsource&utm_medium=testmedium&utm_content=testcontent

    Thank you so much

    Plugin Author Nick Ciske

    (@nickciske)

    Try this

    
    // Autofill fields based on thew query string (using Google Analytics tracking variables in this example)
    
    add_filter( 'salesforce_w2l_field_value', 'salesforce_w2l_field_value_querystring_example', 10, 3 );
    
    function salesforce_w2l_field_value_querystring_example( $val, $field, $form ){
    
        $form_id = 1; // form id to act upon
        
        // return early if this is not the form we're looking for
        if( $form != $form_id ){
    	    return $val;
        }
        
        // Map fields to query variables
        // Query string variable to fetch and return => API Name of the field you want to autofill   
        $map = array(
    	    'utm_source' => 'utm_source__c',
    	    'utm_medium' => 'utm_medium__c',
    	    'utm_content' => 'utm_content__c',	    
        );
    	
    	// Do we have a match?
    	$key = array_search( $field, $map );
    	
    	// Override field value with query string value
        if( $key ){
            if( isset( $_GET[ $key ] ) ){
                return $_GET[ $key ];
            }
        }
    
        return $val;
    
    }
    
    Plugin Author Nick Ciske

    (@nickciske)

    Of course change the field names to whatever you’re using.

    Hi Nick

    I added this code to my child theme’s functions.php, and tested it and still no dice

    Here is my form fields config, am I missing something? http://prntscr.com/hgke1y

    Please explain as if you were speaking to a 4 year old in a different language. Explain each thing 3 different ways and reference exact locations for what you mean because I still do not fully follow what you mean by “change the field names” Where??

    Thank you so much.

    -S

    Plugin Author Nick Ciske

    (@nickciske)

    Sorry, teaching you PHP is outside the scope of free support.

    If you want to hire me to get this working:
    https://luminfire.com/support/premium-plugin-support/

Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘Creating new fields that map into your Lead’ is closed to new replies.