• Resolved iamdev

    (@iamdev)


    add_action( 'give_fields_donation_form_register_login_fields', function( $group ) {
    $group->append(
    give_field( 'text', 'address' )
    ->showInReceipt()
    ->minLength(2)
    ->label( ( 'Your Address' )) ->maxLength(100) ->placeholder('Enter Address') ->storeAsDonorMeta() ->required() // Could instead be marked as readOnly() (optional) ->helpText( ( 'We will never share your address with anyone' ) ) //how this is displayed is up to the template, but if the template has help text displayed, this is how to set it.
    );
    });

    add_action( 'give_fields_donation_form_register_login_fields', function( $group ) {
    $group->append(
    give_field( 'text', 'pan' )
    ->showInReceipt()
    ->minLength(2)
    ->label( ( 'Your PAN card' )) ->maxLength(30) ->placeholder('Enter PAN card') ->storeAsDonorMeta() ->required() // ->required() // Could instead be marked as readOnly() (optional) ->helpText( ( 'We will never share your data with anyone' ) ) //how this is displayed is up to the template, but if the template has help text displayed, this is how to set it.
    );
    });


    I am using above code for adding custom fields as based on your documentation mentioned here: https://givewp.com/documentation/developers/how-to-create-custom-form-fields/

    But this field doesn’t show up when exporting data neither it shows anywhere else.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Matheus Martins

    (@matheusfd)

    Hi, @iamdev.

    Glad you reached out.

    You are not seeing the custom field when exporting because exporting custom fields are a bit different. Exporting a custom field differs from exporting a general field because a custom field is created and associated with a specific donation form. To export custom fields, navigate to Donations > Tools > Export Donation History > Generate CSV. Click on the desired form under ‘Filter by Donation Form.’ After selecting the form, scroll down to the ‘Custom Field Columns‘ section, where your custom fields will be displayed. Choose the specific custom fields you want to export from there.

    Thanks for using GiveWP! Have a great day.

    Thread Starter iamdev

    (@iamdev)

    It doesn’t show any custom field option? here is the screenshot
    https://prnt.sc/A70VVFThU_rV

    Thread Starter iamdev

    (@iamdev)

    If you see the code carefully, it store the field data as donor meta, so how can I get this field to export.

    give_field( 'text', 'pan' )
    ->showInReceipt()
    ->minLength(2)
    ->label( ( 'Your PAN card' )) ->maxLength(30) ->placeholder('Enter PAN card') ->storeAsDonorMeta() ->required()
    Thread Starter iamdev

    (@iamdev)

    Any Idea?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Issue exporting custom fields’ is closed to new replies.