6.5 Data Connector
Origin 2019b introduced a new import method, Data Connector. It builds a connection between Origin worksheet/matrix and a data source from local or online, and then you can choose to import or update data. Comparing to the traditional import tools, Data Connector has several advantages.
- Importing data with Data Connector not only saves your data from mis-modifying, but more important, makes your worksheets more dynamic. Once the connection is built, the imported data area is locked and protected from editing. You can always click on the connector icon to update data, change the data source or import settings.
- Multiple file types are supported. Some frequently-used third party file types are provided as default menu, such as CSV, JSON, Matlab files, etc. Importing from Origin project file and external link (HTML table) are also supported. OriginLab will continually develop new data connector Apps for specific file types. You can always search and download desired connector Apps from the File Exchange area of the OriginLab website, and then install it to build your own Data Connector menu.
- Data Connector can handle large data well. By default, the imported data will be cleared on saving, and only the connection kept. This reduces the project file size.
If a worksheet/matrix has a data connector, a connector object is added to the top-left corner of this worksheet/matrix. This object holds all the information used to maintain the connection of the data source and the destination worksheet. Different connection status shows different icons:
- - the sheet is used as the destination of a data connector,
- - the sheet is not yet used by a data connector,
- – there is updates in the data source
- - the data source is from a file and the file does not exist.
When the mouse hovers over the connector icon, a tooltip appears showing the basic description of the connector. You can right click inside the tooltip and select Copy to copy out the description.
Dialogs and Menus
Besides, Data menu and Data Connector icon' context menu provide quick access to change the data source and import settings, reimport data, break the connection, etc.
| Auto Import
|| Auto import can be triggered in one of the following cases:
- when open the project
- when data source has changes
| Disconnect Sheet
|| Remove the connection between the worksheet/matrix and the data source and also the edit protection. Note that the connector icon remains allowing you to reconnect and import data later.
| Exclude Imported When Saving†
|| Check it to clear the imported data but keep the connection when saving the workbook or project, which helps to decrease the project size, and allows to simply re-import the data when needed. If a graph is plotted from the imported data, there is also a download button appearing on the graph after the imported data has been cleared.
For an example, open sample project Statistics-Multivariate Analysis - Discriminant Analysis (Pro) by Help: Learning Center and set Samples in = Statistics-Multivariate Analysis in Analysis Samples tab. Try menu "Data: Re-Import Directly" to reimport the data. And then try to check and uncheck Exclude Imported When Saving and see the difference of the project size.
| Common Data Path
|| Set a common data path which can be used to quickly access source files by Data Source menu. This path shares between all books in the project and will be saved with the project. |
It is usually to set the parent folder as Common Data Path. The advantage is even more obviously if you set the Common Data Path to a shared folder accessed by your group members and then share the project with them.
†Since connector-imported data are NOT saved with the project file, by default, users should ALWAYS ask themselves whether they need to preserve imported data. This is of particular concern when the data source is web-based and stored in a place beyond your control. If you prefer to save data imported via a Data Connector, with your Origin file, click the Data Connector icon and clear the check mark beside Exclude Imported When Saving prior to saving your file. Note that each Data Connector-containing book will have its own Exclude... check mark.
| Clone Import
|| Available for data imported by Data: Import from File menu. After you import a data file by Import from File menu, ‘’’Clone Import’’’ will use the active workbook (including import settings) as template to import new file into a duplicate of current workbook. If the current workbook contains analysis, recalculation in the duplicate is triggered automatically regardless of the analysis tool's Recalculate mode.
For an example, open sample project Batch Processing - Clone Import by Help: Learning Center and set Samples in = Batch Processing in Analysis Samples tab. Activate workbook and try menu "Data: Clone Import" and choose another data. See how the active workbook is cloned with the new data.
Currently Data Connector can import one file/table at a time. If you want to import multiple table on the same webpage, or multiple files in the same path, you can use ‘’’Add Worksheet’’’ menu to quickly import them to the same workbook.
- Import a file/table by Data Connector.
- Right clicking on the worksheet tab and choosing Add.
- A new worksheet with data connector is added. The data source is prefilled with the data source in the book but doesn't connect. You can change to import a new table.
Note that each workbook can have different data sources, but only one particular connector type (such as CSV, JSON or OPJU). That is, each worksheet in it can have its own data source that is supported by that connector type.
- Select Data: Connect From File/Web: Add New.
- This will open App Center with category set to Data Connector. Browse and find the file type you want to connect, and download it. Once downloaded, it will be added to the Data menu automatically for you to use. You can also find the App in Data Connector tab of App Gallery.
Save the Project as Analysis Template
After making the analysis and graph, you may need an easy way to clear the import data and make an analysis template so you can use this project as a working routine.
- Select File: Clone current Project.
- In the Data Manipulation dialog,
- The current project name and full path are shown if it has been saved. You can choose to
- Add Data Connectors to worksheets that have not connectors yet. Please note that Add Connectors is available only when the current project has been saved. The data source of the newly added Data Connector is the current project file.
- Clear all data or just the imported data (including data imported by menu Data: Import from File).
- If the current project contains recalculation, you can choose to delete the recalculated columns or set the recalculation to None.
This will create and open a duplicate of the existing project named UNTITLED.opju, in which all the windows and operations in the original project are kept. At the same time, all the imported data will be cleared but the connection between the data source and the destination worksheet will be kept. You can then simply update the data source, and all the worksheets and graphs are automatically updated.