Dropdown with Label and Value - In backend in the Entries i wish the Label, not the Value

Hey guys,
i have a dropdown field with 3 labels. I set for every label a another value (for the email for the customers). But in the backend it saves the value too, but i need the label-name in the entries, not the value.

Can someone help me? Thanks, with kind regards.

Check out the filter gform_entries_field_value and gform_entry_field_value. Examples in those docs show how to show label instead of value.

Thank you Joshua,

my Form has the ID 1 and the selectfield has the ID “input_1_6”. I use for the E-Mail {field:1:value} for the customers and {field:1:admin} for the admin-email.

But, I’m not a typical programmer. I cant say, if this code is right for my solution.

I think its this?

add_filter( 'gform_entry_field_value', function ( $value, $field, $entry, $form ) {
    $classes = array(
        'GF_Field_Checkbox',
        'GF_Field_MultiSelect',
        'GF_Field_Radio',
        'GF_Field_Select',
    );
 
    foreach ( $classes as $class ) {
        if ( $field instanceof $class ) {
            $value = $field->get_value_entry_detail( RGFormsModel::get_lead_field_value( $entry, $field ), $currency = '', $use_text = true, $format = 'html' );
            break;
        }
    }
 
    return $value;
}, 10, 4 );

I would delete GF_Field_Checkbox, GF_Field_MultiSelect and GF_Field_Radio. But i dont know if its work and how can i say it should work only for Form ID X and Fiel ID X.

It is cost much time to edit this code?
Thank you, Costa

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.