Preventing commas from splitting linked parent task names in formula

Hi folks,
I need help with a Coda formula to create a new subtask within an existing task. The subtask should correctly reference the full name of the parent task, even when the parent task’s name contains commas. My current formula splits the task name when it includes commas, leading to incorrect assignment. How can I modify my formula to handle this correctly? It’s driving me nuts :slight_smile:

Here is the formula I’m using:

[All tasks]
.AddRow(
[All tasks].Tasks,
“New subtask”,
[All tasks].[Big steps],
thisRow.[Big steps],
[All tasks].Urgency,
thisRow.Urgency,
[All tasks].Importance,
thisRow.Importance,
[All tasks].[Parent task],
thisRow.Tasks
)
.OpenRow(
viewOrLayout: [Parent & subtask], viewMode: “center”
)

I forgot to mention - this is a button formula.

I’ve tried ToText(), Concatenate(), etc. but no matter what - when the task name (this.Row.Tasks) contains a comma, it will set the value for [All tasks].[Parent task] not as one task but several tasks.

If you share your doc we can take a look at it.

Sure thing, here we go:

Thanks a lot!

The problem is you’re assigning the Task text name as the parent instead of the Task row object. The fix is pretty simple.

I’ve corrected in your doc for you. Now when you click the button it will correctly set the parent:

image

Should be all set!

2 Likes

Blows my mind. So simple, I feel stupid :joy: Thanks so much!

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.