Table View to CSV Documentation

Export Html Table To Csv Settings
  • Description
  • FAQ
  • Screenshots
  • DEMO
  • Updates & Support

The Table View to CSV Converter plugin allows you to export table Views as a CSV file (comma-separated values) on the front-end of your site.

A CSV file can be read by spreadsheet programs like Microsoft Excel, Apple Numbers, and Google Sheets, and programs that can read text files like Notepad++.

Exporting Views to CSV brings the full power of Views, with their sophisticated filtering system and flexibility, to exporting Formidable entries. You can customize the content with inline conditional statements, shortcodes, custom text, and anything else you can put in a View.

With this add-on, you can:

  • allow your users to export their own data
  • create a search form of your products and let people export their results
  • give admins robust filtering options to export entries with customized content
  • do a daily backup of the entries of your critical forms

There are several ways to export table Views as a CSV file on the front-end:

Download and Setup

  1. If you haven’t already done so, install and activate Formidable Forms Pro.
  2. In your WordPress admin, go to Formidable → Add-Ons and click the Install button for the Table View to CSV Converter plugin.
  3. Create a Table View for your form. Your View must have the markup for an HTML table (<table>) in the Before Content box in order to be exportable.
  4. Select All Entries or Both (Dynamic) for the View Format.
  5. Choose how you want to export the CSV file for the table View. You can add an export link below a View, use the shortcode, or schedule automatic exports.

Note: The generated filename includes the timestamp of the CSV creation. This date is added to the filename so you can download the same View multiple times without overwriting the first file.

You can control how the CSV file is exported based on the setup of the HTML tags. The Table View to CSV converter plugin exports each set of opening and closing tr tags as a row in the CSV file.

  • In the Content box, each td inside a tr will be a cell in the row.
  • In the Before Content box, each th inside a tr will create a heading cell.

To generate an export link for a user to download the table View as a CSV file, follow the steps below.

  1. In the View settings, scroll down to the Metabox → Export View Settings section.
  2. Select the Show Export Link with View checkbox.
  3. If you would like a custom filename, fill in the Filename box. If you don’t enter anything in this box, the title of the View will be used. By default, the filename will also include a number representing the date. This allows a person to export the same View multiple times into separate files instead of overwriting the same file each time.
  4. The Export Link Text is the label on the export link. Customize the link text to something like “Download your results” or “Export your entries”. Otherwise, the link will use the text “Export to CSV”.
  5. If your view includes filters that get values from the URL, you can decide whether to include the URL parameters for the export. You have two options
    • Yes (more flexible, not recommended for Views with sensitive data) – If selected, URL parameters will be available for the export to filtering and display. Including params is not recommended for Views with sensitive data as these params can be seen and changed easily using browser tools.
    • No (more secure) – Selected by default. This option is more secure. Depending on the filters in your View, the export may include different data.
  6. Preview your View. You should now see an export link to download the CSV file.
  7. Note: The Table View to CSV plugin downloads respect a View’s entry limit but ignore the page size limit.
    • If you have set the View entry number limit to 10, the CSV export is limited to 10 entries.
    • If you have set the View page size limit to 20 entries per page, all relevant entries will be downloaded to the CSV export.

Use the shortcode

The [frm-export-view] shortcode allows you to create a link to download a table View to a CSV file.

Usage

Insert the [frm-export-view view=100] shortcode on a page, post, View, or any other location on your site where WordPress shortcodes are processed.

Note: the [frm-export-view] shortcode isn’t intended to work inside emails. The recommended approach is to put the shortcode on a page and link to that page in your email.

Parameters

Required

Optional

Schedule automatic exports

You can automatically export a table View as a CSV file. The location on your server, and frequency of the export is up to you.

  1. Go to your Formidable → Global settings → Export Views page.
    Automatically Export Html Table To Csv
  2. Schedule CSV Export: Select the View(s) that you would like to export.
  3. Frequency: Choose when you want to schedule the export by days or months, then enter the number. Note: Months are at thirty-day intervals and not calendar months.
  4. Format: Choose the format for your CSV file. UTF-8 is the default format. If special characters in your export are not appearing correctly, try a different formatting option.
  5. Column separation: Enter a single character to use as a separator in your export. By default, a comma will be used.
  6. Destination directory path: Enter the path to a folder on your server to store the exports. Include the root, which is listed beneath the setting for your convenience. If you don’t add a location, the default wp-content/uploads/formidable/exports folder will be created automatically. The default location is an excellent place to save your exports.

Disable Automatic exports

To stop automatic exports of the Table Views, follow the steps below.

  1. Go to your Formidable → Global settings → Export Views page.
  2. In Schedule CSV Export, uncheck the Views you no longer want to automatically export. Uncheck all to stop all automatic exports.
  3. Click Update.

Exporting with parameters

Params can expand what you can do with Views. They can be used to display and filter the view content. Depending on your view filters, if params are changed or removed, people may potentially see data they shouldn’t.

The Table View to CSV Converter plugin gives you the choice of how you would like to work with parameters. Below are the following options.

  • Choose not to export with params
    • In the View Export settings → Include params with your CSV export setting, select No. With this option selected, parameters are not added to the link to export the View.
  • Choose to export with params
    • In the View Export settings → Include params with your CSV export setting, select Yes. With this option selected, params from all sources are added to the link.
  • Export some params but not others
    1. In the View Export settings → Include params with your CSV export setting, select Yes.
    2. In the After Content box of the View (after the closing table tags), set the values of the params you don’t want to be added to an empty string with [frm-set-get]. e.g. [frm-set-get color=””]

Params included with export

You can set parameter values in different ways:

If you choose to export with params, all params will be shown in the export link. This will include those in the URL, the [frm-set-get] shortcode, and form and View shortcodes.

Security

It’s relatively easy for someone who knows how to use browser developer tools to see, save, and change the link used to export a View. The key data in the export link is obfuscated to make it difficult to change the link and export different data. Several security measures are included to protect sensitive data.

For security purposes, created links can only be used for a limited time. The default is 24 hours. If the link is included in an email, including a note that the link expires may be helpful.

If you want to change the expiration time for visitors who are not logged in, use the frm-export-view-link-expiration-hours hook.

You can invalidate all links by changing your site salts in the wp-config.php. Learn how to change WordPress Salt Keys. Any saved export links will no longer work.

File protection

File protection is automatically added to the automatic exports folder, so the CSV files with your exports cannot be accessed directly using the file URL. This also prevents your CSV exports from being indexed and searchable by Google and other search engines. If the automatic exports folder already has an .htaccess file, it won’t be replaced.
* Please note that file protection is limited to Apache servers. File protection on Nginx servers is not yet supported.

Logged in users

Links created for logged in users have extra protection to ensure someone else doesn’t download the data. When a link is created for a logged-in user, the link will only function for that user. No other logged in or logged out user will be able to use the link.

Create admin dashboard for exporting

Formidable has built-in CSV exports of entries in the admin area. When exporting a CSV via a table View, you can create an admin dashboard with robust filtering that’s tailored to your needs and preferences. To create an enhanced admin dashboard to export your entries, follow the instructions below.

  1. Create a Table View for your form.
  2. Create a custom search form to filter your View as needed.
  3. Make sure that your View’s visibility is set to private. This setting can be found on the right sidebar of your View builder.
  4. Add the search form and View shortcodes on a page on your site.
  5. Use the free Hide This plugin or frm-condition with the has_role shortcode to only show the search form and search results View to admins.

Troubleshooting

No Views available for export

The Table View to CSV Converter add-on will evaluate whether a View can be exported or not when the View is saved.

  • If your table View was created before you activated the add-on, go to the View builder and save the View again.
  • If your View has a closing table tag in the Before Content box, remove it and save the View again.

If the View with any allowed parameters has no entries, the [frm-export-view] shortcode will not show an export link.

No CSV file created

If you have set up an automatic export but you’re not seeing any CSV files in your directory, try looking in your wp-content/uploads/formidable/exports directory. This is the default location for files to be saved. If there are any issues with the destination directory path you selected, your exports will be saved in the default location.
Make sure your table View has entries. If the table View doesn’t have entries, a CSV file won’t be created.

Missing content

If your CSV export is missing content from the downloaded Table View, here are a few things to check:

  • Do you have any stray content that’s outside of td or th tags?
    • For the headings, only content that is inside th tags, which are inside tr tags, will be included.
    • For the content rows, only content that is inside td tags, which are inside tr tags, will be included.
  • Have you formatted your table rows and cells properly? If not, their content won’t be included.
  • HTML markup, links and images can’t be included in the content. If you want to save an image link, show the link on its own in the View instead of inside an img tag.

Customizations

See the list of available hooks. These include:

or
Shopping Cart
  • Your cart is empty.
Scroll to Top