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.

0 1 96
1 REPLY 1

@Rehan_Ahmed_Khan here is an idea.

Setup:
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

3X_3_4_346262acf26fd13c4f0d7a0d19abab49baca0856.jpeg

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โ€ ) ) )

Top Labels in this Space