WordPress.org

Ready to get started?Download WordPress

Forums

Gravity Forms Salesforce Add-on
[resolved] Likert field compatibility with Survey Add-on (6 posts)

  1. Scott Kingsley Clark
    Member
    Posted 9 months ago #

    I'd like to request the following be added into the GFSalesforceWebToLead class method 'push'. It would go around line 595 right between the single input field handling and the multiple input field handling.

    Gravity Forms uses glikert1235234 random keys for the values of Likert fields, so using a Likert field value for a mapping will produce the wrong value being sent to SalesForce. The following code will match the submitted value to a specific choice, and then properly use the 'text' label for the value instead.

    elseif ( 'survey' == $field[ 'type' ] && 'likert' == $field[ 'inputType' ] ) {
    	// handling likert field values for mapping properly
    	$value = trim( stripslashes( @$_POST[ "input_" . $field[ "id" ] ] ) );
    
    	foreach ( $field[ 'choices' ] as $choice ) {
    		if ( $value == $choice[ 'value' ] ) {
    			$value = $choice[ 'text' ];
    
    			break;
    		}
    	}
    
    	$data[ $label ] = $value;
    }

    http://wordpress.org/plugins/gravity-forms-salesforce/

  2. Scott Kingsley Clark
    Member
    Posted 9 months ago #

    Oops, $label needs to get set there too:

    $label = self::getLabel($field["label"], $field);

  3. Scott Kingsley Clark
    Member
    Posted 9 months ago #

    I'd like to have this compatibility added to GFSalesforce::create too, in the $input_type switch:

    case 'likert':
    	$value = $entry[$field_id];
    
    	foreach ( $field[ 'choices' ] as $choice ) {
    		if ( $value == $choice[ 'value' ] ) {
    			$value = $choice[ 'text' ];
    
    			break;
    		}
    	}
    
    	$value = htmlspecialchars($value);
    	$merge_vars[$var_tag] = $value;
    
    	break;
  4. Zack Katz
    Member
    Plugin Author

    Posted 9 months ago #

    This will be added. Stay tuned!

  5. Scott Kingsley Clark
    Member
    Posted 9 months ago #

  6. Scott Kingsley Clark
    Member
    Posted 9 months ago #

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.