# Combining Multiple columns into one

**URL:** <https://community.parabola.io/t/combining-multiple-columns-into-one/1958>\
**Category:** Ask a question\
**Created:** [August 5, 2021, 12:45am UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958 "2021-08-05T00:45:39Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin\_Saunders](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Justin\_Saunders](https://community.parabola.io/u/Justin_Saunders)\
**Post date:** [August 5, 2021, 12:45am UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958/1 "2021-08-05T00:45:40Z")

</div>

I am wanting to combine multiple columns into one. The issue being that The number of columns I want to combine will vary depending on the data I import into my flow. What I need is the ability to say something like if the column header contains “” then combine into new column. I can’t find anything that will do this, or any work around. Does anyone have any ideas?

---

<div class="post-metadata">

**Author:** ![Adam\_R](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/adam_r/32/2207_2.png) [@Adam\_R](https://community.parabola.io/u/Adam_R)\
**Post date:** [August 5, 2021, 2:04am UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958/2 "2021-08-05T02:04:37Z")

</div>

Hey @Justin_Saunders,

Wanted to flag the concept laid out in this community post with you: [How to delete empty columns / conditional delete of column basic on text string?](https://community.parabola.io/t/how-to-delete-empty-columns-conditional-delete-of-column-basic-on-text-string/1796)

I’d look into combining these steps with the `Merge duplicate rows` step. Hope this helps – let us know how this approach works for you!

---

<div class="post-metadata">

**Author:** ![Justin\_Saunders](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Justin\_Saunders](https://community.parabola.io/u/Justin_Saunders)\
**Post date:** [August 5, 2021, 4:02am UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958/3 "2021-08-05T04:02:25Z")

</div>

Hi @Adam_R ,

Thanks for your email, unfortunately I don’t think that will work, or I can’t get it to work.

I will try and explain it better. I have multiple recipes being imported from bubble, (max 10, min 1 recipes), each recipe comes with its own column of ingredients, the recipes will have some ingredients that are the same and some that are different, so when I am combining these I end up with multiple columns of ingredients, which I am wanting to combine into one column, (i will have to do the same with the price of each ingredient). Unfortunately when I import the data from bubble I might only have 2 recipes, so two columns of ingredients, 10 recipes or somewhere in between, so I can’t just set up a static list of columns I need to combine and delete, it needs to be a bit more fluid. that is why a combine column action where you can say, if any column header contains the “ingredient” combine column.  
Have to setup a call to explain further if needed.

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/daniel/32/732_2.png) [@daniel](https://community.parabola.io/u/daniel)\
**Post date:** [August 5, 2021, 7:40pm UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958/4 "2021-08-05T19:40:00Z")

</div>

Hey @Justin_Saunders,

You may be able to accomplish this using a “Pivot Columns” step. I’ve mocked out a basic template of the flow below:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/e/e0775ecff1643c02584d4a01a9d9a22e44e258f2.png)

In the dummy data that I’ve pulled in from Google Sheets, there is a list of recipes that have ingredients in multiple columns. We’ll want to go ahead and combine these together:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/5/5ca7e10827fb2a6822f296c810c949b9d81490f4.png)

Using the “Unpivot columns” step, we can combine multiple columns into a single column based on a set of rules. In this case, I’ve selected my `Recipe` column as the unique identifier column and switched the Pivot type to `All Columns Except`. You can leave the pivot columns value blank.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/7/7d7721d82bc72dcb8d89e6478a63c3f76168f7e0.png)

The resulting table will combine all of your columns into a single column. From there, use an “Insert if/else column” step to target the `Type` column and check if the value contains `Ingredient`. If so, create a new column and set the value to `True`.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/8/83b06d36c00d0ec6c45589cb432f49292eba53a6.png)

Next use a “Filter rows” step to `Keep` rows where the value in our new column is equal to `True`.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/f/f2396f84923d671b6d988c1ab513d324f07781d2.png)

Lastly, we can use a “Merge duplicate rows” step to merge the `Value` column containing the ingredients based on the `Recipe` identifier.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/9/90a3d6ad0990c9c437b6f63d26c9cec43d6db2a6.png)

If you need to merge that data back with your original table, you can use the “Combine tables” step to merge on a shared `Recipe` name.

Hope that helps!

---

<div class="post-metadata">

**Author:** ![Justin\_Saunders](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Justin\_Saunders](https://community.parabola.io/u/Justin_Saunders)\
**Post date:** [August 5, 2021, 10:14pm UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958/5 "2021-08-05T22:14:35Z")

</div>

Hi Daniel,

Thanks for your email. That does work, unfortunately it doesn’t work for my data. Below is screenshot of how my data presents. Not only is there multiple columns for ingredients, but there are multiple columns for ingredient prices. Then there are percentage columns that need to be kept seperate.  
Hard to explain in an email, but have a look at the screenshot and let me know if you have any further questions. I can get it to do what I want it to do with a work around that I have sorted. Unfortunately the work around only works if it is a set amount of recipes that I am using, and that there will be no change to the number of recipes from file to file that gets imported from bubble. Unfortunately that is not going to happen.

 ![Screen Shot 2021-08-06 at 08.09.07.png](https://us1.discourse-cdn.com/flex020/uploads/parabola/original/2X/4/4cd42469d5b2c26143ef3c2a02a7e984d9490692.png)

---

<div class="post-metadata">

**Author:** ![daniel](https://sea2.discourse-cdn.com/flex020/user_avatar/community.parabola.io/daniel/32/732_2.png) [@daniel](https://community.parabola.io/u/daniel)\
**Post date:** [August 6, 2021, 12:02am UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958/6 "2021-08-06T00:02:22Z")

</div>

Hey Justin,

Just sent you a separate email. Let’s find a time in the future to discuss this over a call. Hope to connect soon!

Thanks,  
Daniel

---

<div class="post-metadata">

**Author:** ![Justin\_Saunders](https://avatars.discourse-cdn.com/v4/letter/j/ac8455/32.png) [@Justin\_Saunders](https://community.parabola.io/u/Justin_Saunders)\
**Post date:** [August 6, 2021, 2:27am UTC](https://community.parabola.io/t/combining-multiple-columns-into-one/1958/7 "2021-08-06T02:27:22Z")

</div>

Hi Daniel,

Booked in for Thursday next week.

Regards

Justin Saunders
