IntroductionUsage LimitationsPlacementSnippetAlternatives
Introduction
The Total field is not made available to configure conditional logic rules, as it is evaluated differently to other fields. The following snippet does make it possible to use in conditional logic rules, but with the limitation that this is only appropriate for conditional logic that takes place after entry submission.
Usage Limitations
Conditional logic using the Total field is only for use on notifications, confirmations and add-on feeds. That is, features where logic is evaluated based on the saved entry.
Because the total field is always the last field to be saved you cannot use it to configure conditional logic on other fields on the form. Displaying other fields based on the total would prevent those fields being saved as the conditions would never match when the logic is evaluated, during submission.
Placement
The snippet should be placed in the functions.php file of your active theme or a custom functions plugin. You will then be able to configure less than and greater than rules based on the value of the Total field.
Snippet
class RW_GF_Total_Field_Logic {
public function __construct() {
add_action( 'init', array( $this, 'init' ) );
}
function init() {
if ( ! property_exists( 'GFForms', 'version' ) || ! version_compare( GFForms::$version, '1.9', '>=' ) ) {
return;
}
add_filter( 'gform_admin_pre_render', array( $this, 'enable_total_in_conditional_logic' ) );
}
function enable_total_in_conditional_logic( $form ) {
if ( GFCommon::is_entry_detail() ) {
return $form;
}
echo "';
return $form;
}
}
new RW_GF_Total_Field_Logic();
Alternatives
Check out our community add-on library to search for the possible options.