WordPress.org

Support

Support » Plugins and Hacks » Gravity Forms Salesforce Add-on » [Resolved] Likert field compatibility with Survey Add-on

[Resolved] Likert field compatibility with Survey Add-on

  • 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/

Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘[Resolved] Likert field compatibility with Survey Add-on’ is closed to new replies.
Skip to toolbar