Notion Answers

Help between Notion users


Register & Ask

It's free & easy

Get answers

Answers, votes & comments

Vote and select answers

Receive points, vote and give the solution

Question

1vote

How to prevent now() function from updating itself?

Hi there! Thank you for your kind attention! I have a database to record the completeness of my daily routine, and I want to implement a penalty system where if I fail to complete any tasks on a given day, I will incur a penalty of 100 points. Additionally, completing tasks the following day should not affect the penalty incurred on the previous day. The following is how I currently have it set up:

  1. Checkbox, named as my task, e.g., 30min exercise.

  2. Formula, named as Complete?_Task, e.g., Complete?_exercise. The formula inside is if(prop("30min Exercise"), date(now()), 0).

  3. Formula, named as Penalty. The formula inside is:
    if(
    and(
        now() > dateAdd(prop("Date"), 1, "days"),
        or(prop("Complete?_exercise") != date(prop("Date"))
        )
    ),
    100,
    0
    )

However, the now() function generates a problem. When I restart the database, the now() function automatically updates, making this penalty system fail. I appreciate your help!

1 Answer

1vote

ShaneRobinson Points2610

Without actually building a test system myself, I think you're going to have to use a static Date field in place of the now() function.

There's no way to "freeze" the output of the now() function.

So instead of using now(), when a new Daily Task record is created, use a "DayTimeStamp" with a regular Date property and then test against that in your Penalty formula.

Please log in or register to answer this question.

...

Welcome to Notion Answers, where you can ask questions and receive answers from other members of the community.

Please share to grow the Notion Community!

Connect