How to Create a Button That Cycles Through a "Status" Select Field

Hi there! I have a project tracker where we’re tracking the development of certain articles on a website. I’ve used a “Calculate” field so that whenever a status is changed, the “Assigned To” field automatically changes to the person who is responsible for the next phase in the project.

Now what I want to do is create a “Hand Off” button column so that when someone is done with their task, they don’t have to go to the “Status” select column and look for the next status that should be used. Instead, all they have to do is click the “I’m Done!” button and it will automatically change the status to the next one in the line.

For example, if you look at the screenshot below, if the status is currently set to “Article in Editing,” when someone clicks the “I’m Done!” button, the status should change to the next one in line, which is “Article Ready for Review”.

How can I do that? I’ve seen it done in The Coda Guy’s docs, but I just don’t know what formula he’s using in the cycle button column.

You can update the value by looking at the images below.

This is the sample formula I have created for you.

SwitchIf(thisRow.Status=="Need Article Selection","Article Evaluation",thisRow.Status=="Article Evaluation","Evaluation Ready for Review")

Hmmm… that didn’t work. Here’s what’s happening: Loom | Free Screen & Video Recording Software | Loom

Disregard! I figured out what I was doing wrong. Thank you so much for your help!

Hey there Rai! The Coda Guy here - aka Scott.

I find the best practice when using cycle type buttons is to cause the button to increment a counter.

Aka, have a column called “counter” that is a number. And every time the button is pressed it adds 1 to that row/column.

So if the value is currently 2, pressing it will turn it to 3

Then you have a table that holds the status. Two columns on this table: Status | Step

The step column is simply a number.

Then you display the status by either:

  1. Using a filter formula to find the status that matches the current counter value
  2. Using a runActions formula in your button to first set an editable status column to the step that matches the counter and then increments the counter.

Let me know if you need a sample doc or anything!

1 Like

See you got it working now. The “why” is because you seemed to use “=” to assign the value. Coda does not assign values in that way, but in the way you discovered.

1 Like

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