Highlight next uncompleted task

Hi, Here’s what I want to do:
I’m using Coda to keep track of reading challenges that I am in. Two of the challenges are a “book chain” type of challenge, where you have to complete the current prompt before moving onto the next, because the next prompt usually depends on some aspect of the previous book.

Goal: Highlight the currently active uncompleted prompt in a chain challenge.

Setup:

  • I have a Challenges database, and a related Tasks database, where each task is related to its Challenge.
    For the Tasks:
  • I have a checkbox column Completed where I can indicate if a prompt is finished.
  • I have a Prompt Order column that increments by 1 for the order of the prompts in the challenge.
  • I have a card view for my Tasks, filtered by Challenges to show all tasks inside of one of these chain challenges (view name = Book Chain 1; Challenge name also = Book Chain 1).

My thinking is that there should be a way for a conditional formatting formula to look at the view to find the lowest Prompt Order among tasks where Completed = false, and subsequently highlight all columns on that card. However, I can’t seem to get anything like that to work. The issue definitely is stemming from asking the formula to find the lowest Prompt Order under the condition of Completed = false.

I’m on day 2 of using Coda and am not a coder so I’m feeling pretty out of my depth. I’d appreciate any help! Thank you!

I have no idea how to do it (since I am a new Coda devotee as well!) but I am super excited by what you built! Welcome to the community!

hi, thank you!! :slight_smile: i am too! i imported from notion and am super enjoying coda so much more!! the ability to do something like filtering out completed tasks for the Possible Tasks dropdown is what brought me here; i’m sure that is possible in Notion, but Coda makes something like that so incredibly easy. i also love the inheriting the source colors!!! overall it feels like a much smoother experience to me so far!

Hi @rdp ,

It’s a great achievement to have built this on your second day, congrats and keep going!

I don’t understand what’s a prompt in your context. Is it just the same as a task?

I don’t see any logic in your document that does this automatically. Do you mean that you are doing this manually at the moment?

I’m also not sure what you mean here, but your current approach for creating a view for each challenge won’t scale.

You could just create a page with a ‘Relation control’ to select a challange (just type /relation in the canvas) and a Task view that uses this control to filter only the tasks that belong to the selected challange. Here’s some extra info: Overview of filtering tables | Coda Help Center

If you clarify my previous questions and redo/simplify your doc a bit, we can keep looking into the conditional formatting topic.

Hope this helps,

Pablo

Thank you!!

  1. Prompt? Task?: Yes, sorry, a prompt is a task in the challenge.
  2. Prompt order incrementing: Yes, I’m doing this manually. For some challenges, it doesn’t matter, or I simply don’t care.
  3. I’m confused by what you’re suggesting here. Does the table on this page not do what you’re suggesting, with filtering a Tasks table by challenge?: https://coda.io/d/_dgI_katxrBW/Book-Chains_su7ZdMHa

Something like this, but still don’t understand what do you want to highlight

This is what I want to be able to do:

Currently, I am able to highlight “lowest Prompt Order + Completed is unchecked,” but if I check “Completed”, then the lowest Prompt Order never recalculates. For example, if I uncheck Prompt 1 in Book Chain 1 here, then it will turn green. Checking it again renders it in white and #2 does not highlight.

I adjusted the doc, can you check if that fulfills what you are trying to accomplish? Then i can explain a bit more the basics behind

Oooooooh this is very cool!!! Yes, this achieves exactly what I was looking for; thank you!! I think I have an idea of some of what you’ve done here, but please explain it!

This toggle thing is also very cool, and I see now what you were saying about the relation dropdown thing; I may be tweaking my dashboard based on this!

I’m glad it solved your issue!

Here’s the basics behind:

  • In your original doc you were creating separate pages and views for each Challange. That means that every time you add a new Challange you would need to manually create new pages/views, which is a lot of work. Instead I created a single view, that uses a canvas control to filter the information related only to the selected challange.
    If you want to also display challange info in addition to task info, you can create a ‘detail view’ on top of the other that is filtered by the same control. Here you have a couple of useful links:
  • I created a helper column NextUncompleted to identify which card should be highlighted according to your requirements.
    Tasks.Filter(
      Challenges.Contains(thisRow.Challenges) 
      AND Completed.Not()
    ).[Prompt Order].Min()=thisRow.[Prompt Order]
    
    • The first part of the formula filter() selects only the tasks that belong to the same Challange as the current row and that are not completed
    • Of all those tasks, we get the lowest (Min()) ‘Prompt Order’.
    • If the ‘Prompt Order’ from the current row is equal to the minimum from the previous step the formula returns true, if not false.
    • Learning how toFilter()probably will take you some time, but it’s one of the most powerful formulas: Use the Filter formula | Coda Help Center
  • I used NextUncompleted to create a simple conditional formatting rule

Since I shared the document in play mode you should be able to take a look at all the formulas, but you can also copy the doc and play around by making changes.

1 Like