• Resolved Alex Frison

    (@seville76)


    Hey Doeke,

    thanks a lot for this awesome plugin!

    I know you can exclude metadata in your export file, but how can I exclude some specific data. Because of data protection I would like to exclude “Name” and “E-Mail” from the exported file. Is it somehow possible?

    Thanks a lot for your help!

    Alex

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Doeke Norg

    (@doekenorg)

    Hi Alex,

    You’re welcome. I’d love for you to leave a small review, if you’d like!

    I’m hoping to make the UX a bit friendlier for this in the future, but something like this can get you started:

    add_filter("gfexcel_field_disable", function ($disabled, $field) {
        $field_ids_to_disable = array(1, 2);
        if (in_array($field['id'], $field_ids_to_disable)) {
            $disabled = true;
        }
        return $disabled;
    }, 10, 2);

    You can make this as complicated or simple as you like. If the filter receives a true, the field will be disabled.

    Hope this helps. Let me know!

    Thread Starter Alex Frison

    (@seville76)

    Hey Doeke,

    thanks for the very quick reply! Awesome!

    One thing I noticed, if I want to export all forms, then neither the excluding of metadata nor excluding of Name and E-Mail ist working. It only works if I download the excel file for a single form. Would that be possible to accomplish it for the export of all files? That would be really great, since I always use the download for all forms.

    I surely will give you a 5 star rating!

    Thanks a lot in advance!

    Alex

    Plugin Author Doeke Norg

    (@doekenorg)

    HI Alex,

    Been debugging this for a while, and I think I got it.

    If you could change your gfexcel.php-file, and change plugins_loaded to wp_loaded.
    I think that should solve your problem. And if this works for you, this will be implemented in the next version.

    Let me know!

    Thread Starter Alex Frison

    (@seville76)

    Hey Doeke,

    really great support, I have to say!

    I made the change and it partial worked.

    The problem is, that after the change, I wasn’t able to export an excel file of just one form. The link just vanished, when go to the settings and want to select result in excel.

    Also, on some forms the email column and name column was gone but on some forms only the name column was gone but the email column was still there, always when I have captcha included in the form.

    On forms, where I don’t have name or email in this form, other columns were gone. Is it possible somehow to say by column name to eclude them?

    Another question Doeke,
    Is it somehow possible to say, off all meta data, I want to keep the date, since this is no personal data? And also able to seperate date and time in two columns, as you did the separation of the name in two columns.

    Cheers and thanks a lot you hanging in there!

    Alex

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi Alex,

    Thanks for the feedback. Luckily it was a simple fix this time šŸ˜‰
    You can revert the last change, and open up src/GFExcelAdmin.php and change line 34 ($this->handle_bulk_actions();) to:
    add_action("wp_loaded",array($this,'handle_bulk_actions'));

    That the trick for me, to get both working.

    In response to your second question:

    The filtering I gave you was just an example using the field id’s. Every form has its own fields, and it’s own id’s. So you have to extend the function to also check against the form_id. But another option can also be, like you said, to filter against a fieldname, or type, or.. well, it’s a long list.

    Something like this.

    add_filter("gfexcel_field_disable", function ($disabled, $field) {
        $field_names_to_disable = array('Name','Surname','Age');
        //useful filters are: $field['label'], $field['id'], $field['formId']
    
        if (in_array($field['label'], $field_names_to_disable)) {
            $disabled = true;
        }
        return $disabled;
    }, 10, 2);

    To answer your last question:

    I’m currently working on expanding on the metadata, to help with an other support question. I’ve almost finished this, and this will make it so that metadata fields are filterable, like every other field. And can also be split using a custom field transformer. I really like the idea of splitting the date and time, so maybe I will add a native transformer in the future.

    Hope this helps for now. The next release will have your update, so you can just update when it arrives.

    Thread Starter Alex Frison

    (@seville76)

    Hey Doeke,

    I left you a review. šŸ™‚

    Thanks a lot for trying to solve it.

    So the thing is running very well and the approach with naming the labels is great and it looks like everything works!

    But I also had an edge case, which it took a bit to find out.

    One person left a comment with this special thumbs up icon
    “Tolle Webseite mach weiter so šŸ’ŖšŸ–’”

    If this is somewhere in the entries, everything after this entry will be messed up and the following happens:
    After I download the excel file with all forms in it and opened the excel file, Office gives me a warning that it found a problem with some content and it would try to restore it if I trust it.

    When I click yes, it opens the file and on top there is a message, that the editing of this file could make harm on my computer.

    When I check the first 3 tabs (forms) in this excel file, everything looks good, but the fourth and all other forms are completely messed up, with almost no or few content and completely mixed up. After some investigation, I found out, it is the last specific entry with the thumbs up, which screwed the whole table. Maybe a think you should check on, before others have the same problem. šŸ™‚

    The think with metadate filterable, native transformer and splitting sounds great!

    Thank you so much!

    Alex

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi Alex,

    I saw the review, thanks a lot!

    And thanks you for this issue. I’ll look into it. Next version uses a new excel renderer, so hopefully this is already fixed šŸ˜€

    Plugin Author Doeke Norg

    (@doekenorg)

    Hi Alex, last update šŸ˜‰

    Version 1.2.4 is out now. And as I hoped, the unicode / emojil stuff is fixed with the new excel renderer!

    AND, drumroll… You can split the date and time with the following code:
    add_filter('gfexcel_meta_date_created_seperated', '__return_true');

    Enjoy!

    • This reply was modified 7 years, 1 month ago by Doeke Norg.
    • This reply was modified 7 years, 1 month ago by Doeke Norg.
    Thread Starter Alex Frison

    (@seville76)

    Oh very cool Doeke! Brilliant šŸ™‚

    I have another question, if you don’t mind.

    I do have several forms, where only logged in users can fill out the forms. Each form collects also the user id of each user and is dynamically entered in the entries. So in every entry list I have the user id.

    Is there any way to have entries of different forms exported in only one excel list, not seperated in tabs, but merged together in actually one sheet where you have a possibility before export to select a reference field. Let’s say, user id or email address or whatever. So all entries of all forms of userid 1 will be merged in one line, userid 2 and so on.

    Any experience with that or best way how to accomplish this?

    Thanks a lot!

    Alex

    Plugin Author Doeke Norg

    (@doekenorg)

    Wow Alex, that is some specific stuff :D.

    I don’t have a solution for that with the plugin. And to be honest, it’s way to specific for me to include šŸ™‚

    I would probably write a query for this purpose, and export that as a CSV or something šŸ™‚

    Thread Starter Alex Frison

    (@seville76)

    No problem Doeke,

    just was thinking if this would be even possible.

    But still blown away of your fast response! šŸ™‚

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Exclude fields in export file’ is closed to new replies.