Skip to main content

Merge multiple columns with the Implode Columns service

Merge multiple columns with the Implode Columns service in Productsup.

Introduction

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

Note

Ensure you have set a product identifier to use this service.

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

id

color_1

color_2

color_3

1

red

green

blue

2

gray

black

blue

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

id

color

1

red,green,blue

2

gray,black,blue

Add the Implode Columns service

To add the Implode Columns service:

  1. Go to Data Services from your site's main menu and select ADD SERVICE. Then choose Implode Columns, and select Add.

    add_implode_column_service.png
  2. (Optional) In Name, give the new service a custom name.

  3. (Optional) Define a custom column prefix in Column prefix. The platform uses a column prefix when a service generates multiple columns from one service and it needs a common prefix for all new columns.

  4. For the Service Data Level function, choose to use the service on the import or intermediate level by selecting Import or Intermediate.

    • Use this function for the columns you wish to implode.

  5. Select Add.

  6. 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.

    • Alternatively, you can check the Use regex box and enter a valid PHP regex into the input text field. See Pattern Syntax for more information.

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

  8. In Delimiter, select the delimiter that separates the content once you merge it.

  9. Select Save.

    implode.png

You can add multiple instances of this service by repeating the previous steps.

Edit existing Implode Columns service

To edit settings for your Implode Columns service:

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

  2. Choose the Implode Columns data service and select the settings cogwheel icon ().

Delete existing Implode Columns service

To delete your Implode Columns service:

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

  2. Choose the Implode Columns data service and select the settings cogwheel icon ().

  3. Scroll to the bottom of the page and select Remove this service.