~~NOTRANS~~ ~~Title: CSV Import~~ Version: 1.0 / 2022-03-31 ====== Installation ====== The CSV Import Add-on can be installeded from the Add-on store. Press the "Ready Made Solutions" button at the bottom of the VisionX main view. {{:visionx:addon_csvimport:image1.png?nolink|VisionX Button Add-on Store}} Go to the "Add-ons" category and install the CSV Import Add-on. {{:visionx:addon_csvimport:image2.png?nolink|VisionX Add-on Store}} Restart VisionX to finish the installation of the Add-on. {{:visionx:addon_csvimport:image3.png?nolink|Restart VisionX}} We then have to enable the CSV Import Add-on in the application. Open the application and go to "Modules" menu item on the VisionX toolbar menu. {{:visionx:addon_csvimport:image4.png?nolink|Application Menu Modules}} Enable the Add-on in the application by selecting the checkbox on the "CSV Import" row. {{:visionx:addon_csvimport:image5.png?nolink|Install Module}} CSV Import is now an installed Add-on in this project. {{:visionx:addon_csvimport:image6.png?nolink|Installed CSV Import Add-on}} ====== Import data ====== To import data into an existing table, start the application, open a screen, and press the "CSV Import" button. {{:visionx:addon_csvimport:image7.png?nolink|CSV Import Button}} This opens the data import wizard where we import data from an existing CSV file or excel spreadsheet. Click on the "Upload file" button to choose a file to upload. It is possible to edit the data after the upload. Alternatively, data from a table can be copied and pasted into the text field in the wizard. The following options can be selected for the import: * Delimiters: Enter the character that separates the data in the text file or select the option "Use tab as delimiter". * Ignore empty rows * First row contains column labels * Automatic column detection: When this box is checked, the selected columns will be mapped automatically. Deselect this option to map the columns manually. Each column contains a drop-down list for mapping when manual mapping is selected. {{:visionx:addon_csvimport:image8.png?nolink|Column Mapping}} * Clear before import: The existing data will be deleted before the new data is imported. Review the preview table and verify that the data will be imported as intended. Click the "Import" button to start the data import. **The CSV Import Example Application is also available in the ready made solution store** **The CSV file can be downloaded here [[attachments/Import_New_Data.csv|Import_New_Data.csv]]** {{:visionx:addon_csvimport:image9.png?nolink|CSV Wizard}} The result of the import is shown on the next screen. If any part of the import fails, all data rows that were not imported are displayed in the table under "Failed data rows". Selecting a failed data row will show the reason(s) for failure in the second table. {{:visionx:addon_csvimport:image10.png?nolink|Failed CSV Import}} We can then edit the failed data rows in the table and press "Retry failed". The import will then start again for all failed data rows. {{:visionx:addon_csvimport:image11.png?nolink|Retry failed CSV Import}} If the import was completed successfully the following screen will be shown. Click "Ok" to exit the wizard. {{:visionx:addon_csvimport:image12.png?nolink|Finished CSV Import}} ====== Update data ====== It is also possible to edit existing data in the table. The data will be updated using the record id (primary key). We first export the existing data to a CSV File. Press the "Export" button or just use the following example: [[attachments/Update_Data.csv|Update_Data.csv]] {{:visionx:addon_csvimport:image13.png?nolink|Export Button}} In the Update_Data.csv file, the data in some of the rows has been changed. Therefore, only these rows will be updated during the CSV import. It is also possible to insert new rows in the CSV file leaving the id column blank. In this case, the next available id will be used. Be careful changing the id, since existing data can easily be overwritten. After making all changes, simply import the updated CSV file using the "Import" button. Now let’s take a look at the updated data. The address for the company "Izio" changed from "Buhler Terrace 8" to "Pond Hill 468" and there are also 2 new companies. {{:visionx:addon_csvimport:image14.png?nolink|Updated Data}} ====== Extended Export ====== Installing the CSV Import Add-on also extends the CSV export functionality. The standard CSV Export exports the data of a table to a CSV file. With extended CSV Export, the following options can be chosen: * Delimiter * Use column names as labels * The list of export columns To reset the options to the default extended export, use the "Standard" button at the bottom of the screen. {{:visionx:addon_csvimport:image15.png?nolink|CSV Export Options}} ====== Actions ====== There are several actions available related to CSV imports and exports. Additional Information on how to use actions can be found in the [[:visionx:actions|VisionsX actions documentation]]. {{:visionx:addon_csvimport:image16.png?nolink|Actions}} ===== Default extended Export disabled ===== Disables the extended export per default. ===== Default extended Export enabled ===== Enables the extended export per default. ===== Default hide Import button ===== Hides the CSV import button per default. ===== Default show Import button ===== Shows the CSV import button per default. ===== Extended Export disabled ===== Disables the extended export of a specified table view. ===== Extended Export enabled ===== Enables the extended export of a specified table view. ===== Hide Import button ===== Hides the import button of a specified table view. ===== Show Import button ===== Shows the import button of a specified table view. ====== CSV Example Application ====== You can download the entire CSV example application from the VisionX Solutions Store.