# Maintenance updates

**URL:** <https://forum.seatable.com/t/maintenance-updates/7291>\
**Category:** User Talk\
**Tags:** date-and-time\
**Created:** [March 31, 2026, 5:56pm UTC](https://forum.seatable.com/t/maintenance-updates/7291 "2026-03-31T17:56:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Coen](https://forum.seatable.com/letter_avatar_proxy/v4/letter/c/e68b1a/32.png) [@Coen](https://forum.seatable.com/u/Coen)\
**Post date:** [March 31, 2026, 5:56pm UTC](https://forum.seatable.com/t/maintenance-updates/7291/1 "2026-03-31T17:56:38Z")

</div>

I have a question regarding maintenance administration in Seatable. There is a maintenance table containing a maintenance schedule next to the device name. I want a new record to appear whenever maintenance is performed, containing the next maintenance date (according to the period in the schedule). For example: Suppose device 1 has a maintenance interval of 3 months. If the device was purchased on January 1st, maintenance must be performed for the first time on March 31st. Once this is complete, it must be marked and a new record created with the new maintenance date. I have tried some automations but not successfully. Can someone help me?

---

<div class="post-metadata">

**Author:** ![bha](https://forum.seatable.com/user_avatar/forum.seatable.com/bha/32/4702_2.png) [@bha](https://forum.seatable.com/u/bha)\
**Post date:** [April 1, 2026, 9:23am UTC](https://forum.seatable.com/t/maintenance-updates/7291/2 "2026-04-01T09:23:28Z")

</div>

Hi @Coen,  
For such cases, you’ll probably need a script… Here’s a little Python script I wrote:

```auto
from datetime import datetime
from dateutil.relativedelta import relativedelta
import datetime

from seatable_api import Base, context
from seatable_api.constants import ColumnTypes

base = Base(context.api_token, context.server_url)
base.auth()

MAINTENANCE_DATE_COLUMN = 'Next maintenance date'
MAINTENANCE_INTERVAL_COLUMN = 'Maintenance interval (months)'

MANUAL_INPUT_COLUMNS = [
  ColumnTypes.NUMBER,
  ColumnTypes.TEXT,
  ColumnTypes.LONG_TEXT,
  ColumnTypes.CHECKBOX,
  ColumnTypes.DATE,
  ColumnTypes.SINGLE_SELECT,
  ColumnTypes.MULTIPLE_SELECT,
  ColumnTypes.IMAGE,
  ColumnTypes.FILE,
  ColumnTypes.COLLABORATOR,
  ColumnTypes.FORMULA,
  ColumnTypes.URL,
  ColumnTypes.EMAIL,
  ColumnTypes.RATE,
]

TODAY = datetime.date.today()
tables = base.list_tables()
tables_by_id = {}
for table in tables:
    tables_by_id[table['_id']] = table['name']
table = [t for t in tables if t['name'] == context.current_table][0] #base.get_table_by_name(context.current_table)
columns = base.list_columns(table['name'])
editable_columns = [c['name'] for c in columns if c['name'] != MAINTENANCE_DATE_COLUMN and c['type'] in [t.value for t in MANUAL_INPUT_COLUMNS]]
link_columns = [c for c in columns if c['name'] != MAINTENANCE_DATE_COLUMN and c['type'] == ColumnTypes.LINK.value]
row_to_copy = context.current_row
new_data = {}

for idx, (key,val) in enumerate(row_to_copy.items()):
    if key[0]!= '_' and key in editable_columns:
        new_data[key] = val
new_data[MAINTENANCE_DATE_COLUMN] = str(TODAY + relativedelta(months=row_to_copy.get(MAINTENANCE_INTERVAL_COLUMN)))
new_row = base.append_row(table['name'],new_data)

for col in link_columns:
    linked_records = base.get_linked_records(table['_id'], col['key'], [{'row_id': row_to_copy['_id'], 'limit': 1000}])
    other_table_name = tables_by_id[col['data']['other_table_id']] if tables_by_id[col['data']['other_table_id']] != table['name'] else tables_by_id[col['data']['table_id']]
    base.update_link(col['data']['link_id'], table['name'], other_table_name, new_row['_id'], [r['row_id'] for r in linked_records[row_to_copy['_id']]])

```

To adapt it to your case, you’ll have to set the name of both maintenance date column and maintenance interval columns respectively in variables `MAINTENANCE_DATE_COLUMN` and `MAINTENANCE_INTERVAL_COLUMN` at the beginning of the script. The script is quite complex as I tried to make it as generic as possible: it actually duplicates every columns of the initial row and also recreate the links that the initial row might have.  
You’ll be able to use this script either by clicking a button from a button column, or from an automation.

If you want to learn more about scripts, read the appropriate [help section](https://seatable.com/fr/aide/scripts/) or have a look at the [developer documentation](https://developer.seatable.com).

Bests,  
Benjamin

---

<div class="post-metadata">

**Author:** ![Damien](https://forum.seatable.com/user_avatar/forum.seatable.com/damien/32/5530_2.png) [@Damien](https://forum.seatable.com/u/Damien)\
**Post date:** [April 7, 2026, 10:09am UTC](https://forum.seatable.com/t/maintenance-updates/7291/3 "2026-04-07T10:09:07Z")

</div>

Hello,

I regularly set up this kind of workflow in SeaTable.

As mentioned earlier, using a script is one option. But you can also design a simpler system without automation by structuring your base differently.

**The idea is to use 2 tables:**

- one for devices

- one as an event log (maintenance history)

**Table 1: Devices**

- Device name

- Maintenance interval (e.g. every 3 months)

- Link field to the Events table

- A _“Find Max”_ column to retrieve the latest maintenance date from the Events table

- A formula field to calculate the **next maintenance date** based on:

**Table 2: Events (Maintenance log)**

- Event date

- Link to the Devices table (to specify which device was maintained)

**How it works**

Each time maintenance is performed:

1. You create a new record in the **Events** table

2. Link it to the device

3. The system automatically updates:

This approach avoids complex automations and gives you a clean maintenance history for each device.

---

<div class="post-metadata">

**Author:** ![system](https://forum.seatable.com/uploads/default/original/1X/04603423fe81a46c321283663086c475429e8ccb.png) [@system](https://forum.seatable.com/u/system)\
**Post date:** [April 9, 2026, 10:09am UTC](https://forum.seatable.com/t/maintenance-updates/7291/4 "2026-04-09T10:09:48Z")

</div>

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