Importing dimension items from a CSV

Rob Markwell

Last Update há um ano

Importing dimension items from a CSV is a seamless process in Blox, offering a convenient way to update Items and Properties within a dimension with information stored outside the platform.


Follow the steps below for an example of how to update our Product dimension with a list of products.

Pre-requisites

Before we create and run our source - we need to make sure a few things are configured, ready for the import. Here's a quick checklist of things to make sure before you create the source:

  • Dimension - the dimension in which you are importing must already exist
  • Dimension Properties - if the CSV includes fields or values you wish to import as properties, ensure these properties are created in the dimension
  • Dimension property settings - make sure the properties are correctly configured, in particular with data types. If you are mapping in data values, make sure it is formatted as a number. Similarly for text - ensure the property is formatted as text otherwise the field won't be imported
  • File format - the file being imported should be a simple CSV, without empty rows or inconsistent formatting

Walkthrough

Step 1 : Create and name your Source

Create a new source by uploading your file. It is sensible to give this source a name to make it easy to recognise in future.


Once the file is uploaded, the source will be selectable. Once we select the source we will see a preview of the file within the Data tab.

Step 2 : Create your action

Select the source, and click Add action to create a new action. This action will import the information in the CSV into the dimension in Blox, so we can give it a sensible name such as Import Products.

We can also optionally give it a description to help us remember exactly what the action is doing. Once we are happy, click continue.

Step 3 : Select the Dimension import type

In order to import the data as Dimension items, select the Dimension import type.


You will then be prompted to select the Dimension in Blox which you want to import the items into. Here we have selected the Product dimension.


Next, use the drop down to select the column in the file which corresponds to the dimension item names.


When ready, click continue


🗒️Note: if your file doesn't have column names, click the 'File has no column headers' checkbox. This will automatically add a header within Blox to help map and select the correct columns

Step 4 : Map any dimension properties from the file

Next, we will map any of the other columns in the file into any Properties we have in the selected Dimension.


Blox will display the Properties in the selected Dimension, and you can select the column name in the file which corresponds to the property value for each item.


This step is optional, and if we do not select any columns then the items will be imported with no value in the property. If there are no properties in the selected dimension, this step will also not be required.

Step 5 : Run the source

When you click continue, you will be shown a preview of the items being imported along with any warnings or errors in the Import.


Click Run to run the action, which will then import the information in the file into Blox!

If you want to save the action without running it immediately, click Save on the preview screen. This will save the configuration of the action, however it won't upload the information until you run the source.

If you want to run a saved source in future, you can do so directly from the Source screen in the data tab:

Running a dimension import into a scenario

If your model has multiple scenarios, you can select which Scenario you want to import the Items from the CSV in for.


To do so, select the Scenario dropdown on the preview screen before running the source

Validation, troubleshooting and errors

When importing from a CSV, there are some common issues which can cause issues when running the action. These can include:

  • Multiple rows with the same item name - in this case only the first value will be imported
  • The properties are of the wrong format - in this case the property value will not be imported, but the item will still be imported successfully
  • Too many rows of data - depending on your subscription tier, you may have limits on the number of items you can add to each dimension
  • Connected dimension item doesn't exist - if you have mapped a column into a Property which is connected to another dimension, then you may see an error if the value doesn't exist in the other dimension. The item will be loaded in with an empty property value.

The warnings and errors will be displayed on the preview screen, with each erroneous row displaying more information on the error

Was this article helpful?

0 out of 0 liked this article