Move to new row

We have an Activity Table having following fields , Project_Name, Activity_name, Color_Code, Closed. All projects have equal number of multiple activities for example 20 activities.
We want to start from first activity, it should be in Red color, and when it done, its color should be turn to blue, and automatically the next acivity(which is the next row) should turn in red color.
to remind the user to work on next red acitivity.
Pls. help me how to do it.

@Rehan_Ahmed_Khan here is an idea.

Let’s assume you have a table β€˜Activities’ with the following columns.

  • [_RowNumber] - That’s an AppSheet default, also the Key column of the table
  • [ProjectID] - The name of a project
  • [ActivityID] - The name of an activity (in project [ProjectID])
  • [Completion] - An enum β€˜ToDo’/β€˜Done’

Let’s also assume that for each project, your activities are to be executed in the order of increasing [_RowNumber]

Formatting the Rows:
The idea is to define format rule to apply to each row of your table.

  1. Blue for all activities where [Completion] is β€˜Done’
  2. Red, for the first activity where [Completion] is β€˜ToDo’ in each given project

In the UX section, go to the Format Rules tab, and click on the [New Format Rule] button. The trick is to define the right formula to know when to apply the rule.

For the formatting itself, check the documentation at Format Rules: The Essentials


Format Rule: Blue is 'Done’
That one is easy. Only apply this rule when that activity is marked as β€˜Done’. Define the formula as such in the field named β€˜If this condition is true’.

Formula: [Completion] = β€œDone”

Format Rule: Red is Next
A little bit more tricky there.

For each row, you need to find:

  • The smallest [_RowNumber]
  • Of all the rows of the same [ProjectID]
  • Where [Completion] is β€˜ToDo’

The formula can look like this:

Formula: [_RowNumber] = MIN( SELECT( Activities[_RowNumber], AND( [ProjectID] = [_THISROW].[ProjectID], [Completion] = β€œToDo” ) ) )