205

Product support

Get help in the plugin support forum.

Categories

This plugin will save you a lot of time if you have to work with CSV imports!

With this simple plugin you can upload a CSV file and extract it's contents to a temporary table in your database. You can then create a simple plugin of your own to listen for the briddle.data.imported event to handle what you do with the data in this temporary table.

You can delete the table after you are done with it.

If you want to use multiple different CSV imports, simply check the structure of the temporary table after each upload.

Features

  • Allows backend users to upload a CSV (Comma separated Values) file
  • Add a suffix (e.g. _latest) to the table name that will be used (briddle_data_import)
  • Fires the briddle.data.imported event containing the name of your temporary database table
  • Inspect the created temporary database table (number of rows and column names)
  • Use the briddle.data.imported event to handle the imported data in your own plugin
  • Allow incremental imports (uncheck the replace checkbox)

Support

Please use the Support Forum (on the left side of the page for any theme or plugin) or send me a message. I also offer design and development services. You can visit my website for more information. Do not use reviews to ask for support.

Like this plugin?

If you like this plugin, you can help me to develop it further, provide support for it or make new plugins by making a donation with PayPal (left side of the page) or giving this plugin a good review :).

My other plugins include:

Upload screen

Hello, I am Wiego Bergsma. Please start by reading the whole documentation! If you have any questions, find a bug or experience difficulties getting the plugin to work please use the Support Forum. Only leave a Review if you are happy with the plugin or are still unhappy with the plugin after reaching out to me in the Support Forum. Thank you! Wiego

Installation

To install from the Marketplace, click on the "Add to Project" button and then select the project you wish to add it to before updating the project in the backend of your website to pull in the plugin.

To install from the backend, go to Settings -> Updates & Plugins -> Install Plugins and then search for Briddle.Data.

Getting started

  1. Install Briddle.Data
  2. Configure the plugin at Settings > Misc > Data import
  3. Navigate to Data to upload your CSV file
  4. Create your own simple plugin to handle the imported data

By default, new imports will overwrite any existing temporary tables of the same name! You can uncheck the replace checkbox to allow incremental imports.

Format of uploaded CSV file (.csv)

  • UTF-8 encoded
  • .csv file extension
  • use a comma as the seperator
  • use a double quote as a delimiter
  • the first row of your file contains the column names to use

Maximum size of uploaded CSV file (.csv)

  • About 1000 rows (use incremental imports to handle larger data sets)

Write your own simple plugin to handle the imported data

namespace Acme\Datahandler;

use System\Classes\PluginBase;
use Db;
use Event;
use Schema;

class Plugin extends PluginBase
{
    public $require = ['Briddle.Data'];

    public function pluginDetails()
    {
        return [
            'name'        => 'Data Handler',
            'description' => 'Handling of imported data from Briddle.Data',
            'author'      => 'Briddle',
            'icon'        => 'icon-cog'
        ];
    }

    public function boot()
    {
        Event::listen('briddle.data.imported', function($table,$replace) {

            if (Schema::hasTable('acme_cars_parts')) {
                $result = Db::table($table)
                    ->select('part')
                    ->distinct()
                    ->get();
                if($this->replace){Db::table('acme_cars_parts')->truncate();}
                foreach($result as $row){
                    Db::table('acme_cars_parts')->insert([
                        'name' => $row->part
                    ]);
                }
            }

        });
    }
}

You can choose to delete the temporary table in the database after your own plugin is done with it.

Schema::dropIfExists($table);

If you want to use multiple different CSV files you can check the structure of the temporary table after each upload to decide what to do with the temporary data.

Support

Please use the Support Forum (on the left side of the page for any theme or plugin) or send me a message. I also offer design and development services. You can visit my website for more information. Do not use reviews to ask for support.

1.0.7

Allow incremental imports

Oct 29, 2019

1.0.6

Cleanup navigation

Oct 24, 2019

1.0.5

Updated docs

Oct 23, 2019

1.0.4

Remove anything other than lowercase letters, numbers and underscores

Oct 23, 2019

1.0.3

Automagically convert column names to lowercase

Oct 23, 2019

1.0.2

Automagically replace dashes with underscores in column names

Oct 23, 2019

1.0.1

First version of Data

Oct 23, 2019