Skip to main content

Importing from CSV or Excel files

Quite often, particularly when starting new projects, a good starting point to get some data into Txture is an existing CSV or Excel file. In this tutorial, a small example will be covered in which all the necessary steps to get the data into Txture are explained. More information on the individual steps can be found in the respective administration and Txture Core documentation.

For the scenario in this tutorial, we assume the following:

Step 1: Investigating the Excel file

In the example Excel file, there are two sheets so we end up with two importers. In case you had CSV files, you would probably have two (one for each sheet of the Excel file): one for applications and one for application owners.

Step 2: Accessing the files from Txture - preparing a data source

Since most likely your Txture instance operates on a server and not on your local machine, the next step is to transfer the Excel file to a location where Txture can access them. There are several options depending on whether you want to get started quickly or are planning for a long-term solution (with updates):

  • Upload the file to a File-Upload Data Source: Probably the most straightforward solution is the usage of a File-Upload Data Source. These allow to upload the CSV file and select them to read from in the creation of the importer in step 3.
  • Copy-paste them to Txture directly: Txture allows the creation of text data sources - basically text fields in which you can copy-paste information. Of course this way your information will not stay up-to-date if you change it locally, nevertheless, it might be a good quick starting point.
  • Store them on a folder on the server: If you happen to able to mount a network storage device to the machine running Txture, you can use the folder data source to access your files.
  • Upload them to an S3 bucket: If neither of the above is a good solution, you might want to upload your files to S3 and use the S3 data source to retrieve them. This way you can update from any location and Txture will find new information.

Please note that creating data sources (and importers) requires administrative privileges in Txture.

Step 3: Importing the applications - creating an importer

It is now time to actually import the applications using an asset importer. Proceed to (Main Menu / Admin / Importers) to create a new asset importer.

Give the importer a descriptive name and hit Save.

You are now presented with a complex form that offers a lot of options to configure your importer. For this how-to guide, we will stick to a simple approach, configuring only the absolutely required options. Choose the newly created data source and the appropriate data format (CSV format or Spreadsheet (xls, xlsx)) as the file format. For this example we are going with an Excel import. The CSV import works exactly the same. After selecting the Excel file and the sheet within the Excel file to import, click on Load preview to see a first glimpse of the data. You might also want to select that a header row is available if this is the case in your data file (it is in the example data files). The asset type setting allows you to select which asset type you want to import. In this case, all of our lines are applications so we can use a constant type and select the asset type Application as our target asset type.

Since we are using a perfectly apt data format and no transformation is needed, you can now continue to the Mapping section. This section allows you to configure, which column in the file is mapped to which property in Txture.

It is important to know that the values in the field selected for the Column containing Asset ID must be unique over all imported lines.
You can now proceed to map the columns in the original CSV file to properties in Txture. Eventually, click on Save and Run Now to actually start the data import.

Info:

All importers in Txture are syncing. That means that running them again produces the same result (if the original data hasn't changed). So feel free to try and run the importer again. The statistics will show that some lines 2 lines have been loaded (meaning have been found in the data source), but 0 have been imported (because they haven't changed).

The next step after importing applications is to import the application owners from the second CSV file / second Excel tab. This is left to the reader as an exercise.

Links in Txture are connections between two asset types. In our example, the link between the asset types might be:

Application -> owner (this is the link name) --> Stakeholder

The crucial factor when importing links is how to determine where to attach the links to. Txture offers two options to match the sources and targets of links:

  • based on one or more properties
  • ID-based

Depending on the data set about to be imported even a combination of the two is an option. When looking at the data of our example Excel file, we can see that the ID of the application owner is not used in the applications tab. Thus, in this case, we need to use property matching on the target asset type (Stakeholder) and can use an ID-based matcher for the source asset type (Application). The Conditions section thus looks as follows: