Skip to main content

Merge multiple columns with the Implode Columns service

Merge multiple columns with the Implode Columns data service in Productsup.

Introduction

If you wish to unite multiple columns with corresponding values into one column, you can merge these columns using the Implode Columns data service.

For example, you can merge the varying color columns in the following data source:

id

color_1

color_2

color_3

1

red

green

blue

2

gray

black

blue

After applying the Implode Columns data service, your data may look similar to the following:

id

color_1

color_2

color_3

___imploded_all_colors

1

red

green

blue

red,green,blue

2

gray

black

blue

gray,black,blue

Note

The Implode Columns data service is available for the import and intermediate stages.

Prerequisites

To set up the Implode Columns data service, you need:

  1. A product identifier. See Set a product identifier for more information.

  2. A number of relevant columns in your feed that you want to merge.

Add the Implode Columns data service

  1. Go to Data Services from your site's main menu and select ADD SERVICE.

  2. Search for Implode Columns, select Add, and give it a desired name and column prefix.

    By default, ___imploded is the column prefix.

    add_implode_column_service.png
  3. Choose the stage containing the columns you want to merge in Service Data Level and select Add.

  4. Select the columns you want to implode from the Columns that you want to use as input drop-down list or write the column names directly into the input text field.

    If you chose Import in Step 3, the drop-down list Columns that you want to use as input displays the columns of your import stage. If you chose Intermediate in that field, the drop-down list contains your intermediate-stage columns.

  5. In the field Column that will be created and populated with the selected columns above, enter a name for your merged output column.

    Note

    The platform uses the column prefix and the name you specify in this step to produce the full name of the new column. For example, if you use the default column prefix ___imploded and the output column name is all_colors, the full name of the new imploded column is ___imploded_all_colors.

  6. In Delimiter, select the delimiter that separates the values of different columns once you merge them.

    You can choose from a list of popular delimiters or enter a custom delimiter in the input text field that appears after selecting Custom.

  7. Select Save.

  8. For the platform to process a new data service, select Run in the top-right corner of your site's view.

    Note

    If you can't see the columns that the Implode Columns data service added to your feed in Data View, ensure the platform hasn't hidden them:

    1. Go to Data View from your site's main menu and choose the relevant stage or export in the drop-down list on your left.

    2. Select the menu icon on the right and then select the eye icon.

    3. Find the attributes in the list that use the custom prefix ___imploded and select the eye icon next to each attribute you want Data View to display.

    4. Close the pop-up menu.

    The naming of the attributes created by the Implode Columns data service depends on the column prefix you chose in Step 2. The attribute names the data service generates always start with three underscores (___), which means the platform doesn't send those attributes to your export channels.

You can add multiple instances of this data service by repeating these steps. The platform shows all imploded columns and their source columns in a table at the bottom of the data service setup page.

the table with all imploded columns on the setup page of the Implode Columns data service

Edit the Implode Columns data service

  1. Go to Data Services from your site's main menu.

  2. Search for your data service.

  3. Select the cogwheel icon () next to the desired data service to edit other settings.

  4. Select Save.

Delete the Implode Columns data service

  1. Go to Data Services from your site's main menu.

  2. Select the cogwheel icon () next to the desired data service.

  3. In the Danger Area panel, select Remove this service.

  4. Select Yes.