# Chaining computed columns

**URL:** <https://community.glideapps.com/t/chaining-computed-columns/71347>\
**Category:** Ask for Help\
**Tags:** computed-columns\
**Created:** [March 1, 2024, 10:25pm UTC](https://community.glideapps.com/t/chaining-computed-columns/71347 "2024-03-01T22:25:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![stomgb](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@stomgb](https://community.glideapps.com/u/stomgb)\
**Post date:** [March 1, 2024, 10:25pm UTC](https://community.glideapps.com/t/chaining-computed-columns/71347/1 "2024-03-01T22:25:13Z")

</div>

What is the correct way to compute the equivalent of `Capitalize(Split(ColumnA, 'My sentence always starts with')` ?  
It seems like each column can only apply one transform/computation, but a computed column cannot take as input another computed column?

---

<div class="post-metadata">

**Author:** ![Jeff\_Hager](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/jeff_hager/32/43_2.png) [@Jeff\_Hager](https://community.glideapps.com/u/Jeff_Hager)\
**Post date:** [March 1, 2024, 10:55pm UTC](https://community.glideapps.com/t/chaining-computed-columns/71347/2 "2024-03-01T22:55:54Z")

</div>

Can you explain this function a little more? What would the value in ColumnA look like and what would you expect for a result?

---

<div class="post-metadata">

**Author:** ![stomgb](https://avatars.discourse-cdn.com/v4/letter/s/87869e/32.png) [@stomgb](https://community.glideapps.com/u/stomgb)\
**Post date:** [March 2, 2024, 12:09am UTC](https://community.glideapps.com/t/chaining-computed-columns/71347/3 "2024-03-02T00:09:55Z")

</div>

Sure, let:

- Column A be a column containing text of the following format - and the values are all lower case.  
For example: “fresh fruit - pink lady apples”

I’d like to split the data in Column A into two columns: product category and product name such that I get the following output:

- Product Category: “Fresh fruit”
- Product Name: “Pink lady apples”

In this example, the split delimiter will be (’ - ').  
In my original example, I am actually splitting text values returned from GPT hence the strange delimiter, but the above example has the same pattern.

---

<div class="post-metadata">

**Author:** ![ThinhDinh](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/thinhdinh/32/49_2.png) [@ThinhDinh](https://community.glideapps.com/u/ThinhDinh)\
**Post date:** [March 2, 2024, 1:06am UTC](https://community.glideapps.com/t/chaining-computed-columns/71347/4 "2024-03-02T01:06:19Z")

</div>

Here’s my setup with JavaScript.

![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/c/6cbe44fdb0784abe9671ce83f635da7fc7617ef1.png)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/6/6/66df85d327da081b246fe40466eb85faf3b0cca6.png)

```auto
return p1.split(" - ")[0].replace(/^./, (match) => match.toUpperCase())

```

And for the name, it’s the same, just change the index from the split array.

```auto
return p1.split(" - ")[1].replace(/^./, (match) => match.toUpperCase())

```
