Counting checked items in a checklist inside a table text column

Hello
I have a tasks table that contains a subtasks column, which is just a /checklist inside a text column. I want to update the progress bar based on this checklist, what formula should i use to count checked boxes? i managed to count the total items by counting the number of lines, but I don’t know how to filter the checked and unchecked items.

That would be something like|

Table.filter("name=Tasks 1").Subtasks.count()

Thank you for your reply, this will count the number of subtasks yes but not the number of completed/checked subtasks, i want to count the completed subtasks in order to update progress bar based on it

Hi @Maria_rb and welcome to the Coda Community!

I would suggest you to use another way of managing your subtasks, then it will be much easier to track them and get the data you want. The right data structure is one of the most important things in Coda.

If your hierarchy contains only two levels (“Tasks” & “Subtasks”), the easiest solution for you is to use two tables that are in relation with each other.

Here is an example:

Please let us know if that works for you.

Jannis

2 Likes

It used to work that way. If you share a (dummy) document, I will double check.
edit: I am not sure if checkboxes in one cell will work, but thing changed regardless of one or multiple cells: you need to filter your rows, currentvalue=true()
But I can’t remember if you can easily count checkboxes within one cell.

Hi @joost_mineur,

I assume she is currently using a simple text column where she puts her subtasks in (Please correct me if I am wrong @Maria_rb).

Is there any way to filter text values and check if the checkbox in front of the text value is checked or not?

Please let me know if there is, I am not aware of anything like this. That’s why I suggested using tables instead.

Best regards
Jannis

1 Like

For the sake of completess, to count the number of checked boxes in a cell you can use the following formula:

thisRow.[checkbox_cell]._merge().Split("isChecked").count()-1
2 Likes

Thank you so much this did exactly what I want! here is the final formula I used in the progress column:

((thisRow.Subtasks._merge().Split("isChecked").count()-1)/thisRow.Subtasks.Split(LineBreak()).count())*100

And thank you @Jannis for your suggestion, it’s the best structure as you said but I wanted to keep things as simple as possible for this table, and was also curious to know if I can actually count checked list items inside a text cell :smiling_face: Another good day of being a Coda user.

1 Like

I just got a reminder (thank you @Scott_Collier-Weir ) about one of the recently added functions that makes the formula just a (tiny) bit nicer:

thisRow.[checkbox list]._merge().RegexExtract("isChecked","g").count()
2 Likes

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