PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Export of display entries with Created By as name not ID

  1. The export to CSV and entry Print functions are great, but I am having difficulty getting the username of the person completing the form out in either of the options.

    I need a simple way of displaying all entries on a page or export (.CSV or other format) including the "Created By" field as username/friendly name.

    Out of the box Gravity Forms does this from the CSV as but the field is displayed as User ID rather than the username of the user completing the form.

    The Entries view displays the username when you add the field from the Edit option, but when you use the bulk Print option then this field isn't included.

    Does anyone have any ideas?

    Posted 12 years ago on Friday August 10, 2012 | Permalink
  2. David Peralty

    Can you explain a bit more about what you want? There should be no column not available to you to export, so if the data is saved in the entries screen, it should allow you to check it off as an option to export to CSV.

    Posted 12 years ago on Friday August 10, 2012 | Permalink
  3. Hi David,

    The options on the Entries and what you can export don't quite match.

    On the Entries view you have the option to click "Edit" on the right hand side and "Choose Columns". One of those columns is "User", which when selected then displays the username on the Entries view. This is the information I need.

    If I try to print from the Entries view using the Print option from the Bulk Actions then "User" is not included in the results.

    If I try to Export the entries using Export Entries option then there is no "User" option to select to export only "Created By (User Id)" which the numeric ID and not username.

    Posted 12 years ago on Friday August 10, 2012 | Permalink
  4. I've figured out how to do what I need for the print side of things by adding a filter in my theme's functions.php:

    <?php
    add_action("gform_print_entry_header", "custom_header", 10, 2);
    function custom_header($form, $entry){
      $userdetails = get_userdata($entry["created_by"]);
      echo $userdetails->display_name;
    }
    ?>

    This successfully prints the details I need, but I would like to have the option to complete this in the export as well.

    Does anyone know of a similar filter that can be used when exporting?

    Posted 12 years ago on Monday August 13, 2012 | Permalink
  5. Okay I've managed to answer my own question now.

    I hadn't realised there was the option to map fields including the "field user:display_name".

    I created a hidden field and then mapped this field from the Advanced tab. This gives me exactly what I need with the flexibility to export or do whatever I need including displaying on the front end with the unofficial Directory plugin.

    Posted 12 years ago on Monday August 13, 2012 | Permalink
  6. David Peralty

    Glad to hear it. Let us know if anything else comes up, and thanks for posting details on how you did it. I am sure it will help others.

    Posted 12 years ago on Monday August 13, 2012 | Permalink

This topic has been resolved and has been closed to new replies.