Tailwind Logo

Content Hub - Leveraging Excel Export and Import

Digital Asset Management

Published: 2021-11-23

When uploading files and adding metadata, you might need to input various fields. While the Excel Import feature for registering new assets is useful, this time we will introduce the process of batch updating assets using Excel Import and Export.

Prerequisite

In this article, we will be working with the Sitecore Content Hub after it has been set up. The version we are working with is 4.1.5, but this feature is version-independent as it has been available since before the acquisition of this product.

Excel Import and Export Settings

In this case, we would like to display the Excel Import and Export items on the Asset Upload screen. To do this, open Manage - Pages and select the Create page.

excel01.png

In the right area of the header there is a Creation item. This controls for making additions, so enable customization and go to the detail page.

excel02.png

In the list of settings on the left side, there is an item for Import Excel.

Then activate the Selection item in the same area for customization.

excel03.png

When you move to the settings screen, check the Enable export to Excel item.

excel04.png

This completes the Excel import and export settings on the Create page.

Check the exported data

I uploaded about 7 files to the Create page via Drag & Drop. Select all of them and check the ... menu item to see that the Export to Excel item is displayed.

excel05.png

If you export and open the file, you will see the following Excel file.

excel06.png

The first line defines which item is the M.Asset. In particular, the identifier is a unique value that serves as an identifier of the asset in the Content Hub, so that we know which asset we are importing. The first line defines two important values: the id and the identifier.

Importing Data

First, save the Excel file with Demo Data in the Description of the downloaded Excel file, and check if it is imported.

Click the Add button in the upper right corner of the screen to see that Import Excel has been added.

excel07.png

Select the menu and drag & drop to upload your edited Excel file.

excel08.png

After the import process is complete, open all items in batch edit mode and you will see that the import was successful.

excel09.png

Tie to product information

By adding items to an Excel file, we can set values for other data in bulk. In this case, we want to link product information to PCMProductToAsset, which will be product information. The identifier of the product information created in the sample is CuacMlKhukCLR45FWDTV0Q, so the added data will be the following items.

excel10.png

After a few moments, the settings are updated to the asset settings associated with the Product Detail.

excel11.png

The asset list can also be used to check the assets connected to the product information.

excel12.png

Make product information identifiers easy to find

The above procedure suddenly became the identifier of the product information to be associated with, but we will introduce the procedure for displaying this in the product information at the end of this section. First, from the Manage - Pages administration tool, go to the edit screen of the Product Detail page.

excel13.png

This time we will add a component under the Entity image viewer so that it is always displayed. Click on the + button to switch to the following screen.

excel14.png

Select Entity details to display the value of the Entity in this case. The title of the Entity is "System" in this case. You can also choose whether or not to always display the Entity as an item. In this case, we will leave it as "Always" because we expect to use it often.

excel15.png

The added screen is as follows: click on System to proceed with the configuration.

excel16.png

Since we want to select only the items we want to display, we enable System Properties, set Label to System, and set Identifier as the only item to be displayed.

excel17.png

If you actually go to the product information page, you will see that the Identifier is displayed on the left side.

excel18.png

One previous step suddenly has a value, but if you have completed this step in advance, you will know which product to pull to tie it to. The values are not easy to understand, but since the tying itself is done using data, it is easier to work with them if you can check them.

Summary

After uploading an asset, we introduced the ability to edit and update the exported data in Excel outside of the browser screen. By using this feature in conjunction with the Excel export item control previously introduced, editing can be done offline.

Tags