🐙

Building a Count-Up Feature in a Notion Database

This article was automatically translated from theJapanese original by AI. It may contain translation errors.

This post was published over 1 year ago. Its content may be outdated.

🥞 The finished product

Demo of the count-up button in action

🍳 Let’s cooking

🐱 Creating the properties

First, add the following two properties to the database.

  • A “Number” property that holds the value
  • A “Button” property that implements the count-up button

This time I defined the number as “View count” and the button as “Count up”.

”Number” property”Button” property
The Number propertyThe Button property

🐑 Creating the variable

Once you’ve created them, click the button’s header and select “Edit automation”.

Opening the button's edit automation menu

A screen like this appears, so click “New action”.

The automation editing screen with the New action option

First, select “Define variable” to create a variable that holds the new view count.

Selecting Define variable

This time I named the variable newViewCount. The variable name can be anything.
A field for entering a formula appears, so click it and select “This page”.

Selecting This page in the formula field

After selecting “This page”, a list of the properties of the table you’re editing is displayed.
Select and click the property name you set up earlier. This stores the value currently set on that property into the variable you defined.

Selecting the property to store in the variable

Since we want to count up this time, enter a formula so it becomes the current value + 1.

Entering the current value + 1 formula

Once you’ve done this, the action looks like this.

The completed count-up action

☕️ Assigning the variable

The newly created variable now holds the current value + 1, so we assign this value back so it becomes the current value.
Click “Add action” and click “Edit page”.

Adding an Edit page action

Click “Select database” and click “This page”.
Next, click “Edit property” and select the property you want to change. (In this case, select “View count”.)

Selecting the property to edit

A formula input field then appears, so click the Σ mark on the right side of the field and click the variable name you defined earlier. (This time, “newViewCount”.)

Inserting the variable via the sigma mark

Once this setup is complete, press “Save” to finish 🌱

🍁 Result

The finished automation configuration

The count-up feature working end to end

Recent Articles

Network(beta)

Drag to move / Ctrl+wheel to zoom