Help

Upcoming database upgrades. to improve our reliability at 03:30 UTC on Feb. 25 / 7:30pm PT on Feb. 24. Some users may briefly experience slow load times or error messages. Learn more here

Set a field value if condition else do nothing

Topic Labels: Formulas
474 1
cancel
Showing results for 
Search instead for 
Did you mean: 

I have a table with a status column. I created a Kanban view for these status and I would like to set the current date when a certain status is set.

For example when status is STARTED set the started_date column to NOW()
So I use the following formula :

IF(status = 'STARTED', NOW())

It works to set the date but the issue is when I switch the item to the ENDED status the started_date is cleared.

I would like to know if there is a way to set the column value when the condition is true and do nothing when it’s not.

Thnaks

1 Reply 1

Hi,

Suppose you define possible statuses as ‘_empty’, ‘PREPARATIONS’, ‘STARTED’, ‘COMPLETED’, ‘_rejected’

You can write smth like
IF(
OR(‘STARTED’, ‘COMPLETED’, ‘_rejected’),
NOW(),
)
and the condition remains TRUE after you reach ‘STARTED’ stage

but you have other issue (even with your formula) - when you open the table tomorrow, and next days, started_date will update every date, and it’s meaning became nonsense.

formula is dynamic. if you want to create some static value, you may add checkbox field “start” (and hide it, if needed), and set “Start date” as ‘modified time’ of that checkbox field.
or you can use automation “When record matches condition” to put date into field.