# Automate timeslot generation

**URL:** <https://forum.seatable.com/t/automate-timeslot-generation/6970>\
**Category:** Automations\
**Tags:** date-and-time, calendar\
**Created:** [September 17, 2025, 12:59pm UTC](https://forum.seatable.com/t/automate-timeslot-generation/6970 "2025-09-17T12:59:58Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![userroy](https://forum.seatable.com/letter_avatar_proxy/v4/letter/u/f6c823/32.png) [@userroy](https://forum.seatable.com/u/userroy)\
**Post date:** [September 17, 2025, 12:59pm UTC](https://forum.seatable.com/t/automate-timeslot-generation/6970/1 "2025-09-17T12:59:58Z")

</div>

hi,

Exploring Seatable enterprise to see if it can help us build a custom booking/scheduling system.

I have a table “timeslot\_types”, with various properties of different kinds of timeslots.

 ![fig1](https://forum.seatable.com/uploads/default/original/2X/d/d12db6d3392276ea442eb5e650664b058fa2a177.png)

In a different table “timeslots”, I (so far manually) add rows where I only specify the field “time\_slot\_date” (WITHOUT time component), and through links to the “timeslot\_types” table and some link formulas, I can create fields “time\_slot\_start” and “time\_slot\_end” (WITH time components, so now viewable in a calendar).

 ![fig2](https://forum.seatable.com/uploads/default/original/2X/5/5c8c84d42d34cae5f963e47cfa736d0e610ad56b.png)​

(In the above, I should still include a “timeslot\_id” field.)

I’d now like to be able to automate the generation of records in “timeslots”. E.g., for the period between [date\_start] and [date\_end], create 6 timeslots per day (2 of code01, 4 of code02). So for a period of 60 days, this should result in 60\*6 = 360 records.

Is something like this is possible?

---

<div class="post-metadata">

**Author:** ![rdb](https://forum.seatable.com/user_avatar/forum.seatable.com/rdb/32/1869_2.png) [@rdb](https://forum.seatable.com/u/rdb)\
**Post date:** [September 17, 2025, 1:27pm UTC](https://forum.seatable.com/t/automate-timeslot-generation/6970/2 "2025-09-17T13:27:13Z")

</div>

There is no no-code way. But with a script, you can achieve what you try to do.

---

<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:** [September 18, 2025, 7:28am UTC](https://forum.seatable.com/t/automate-timeslot-generation/6970/3 "2025-09-18T07:28:39Z")

</div>

Hi @userroy,

There are probably different ways to achieve what you want, but you won’t be able to avoid a script. Here are few additional thoughts, remarks:

- I definitely recommend using a Python script because you can create multiple lines at once
- Will you have to deal with days “off” between [date\_start] and [date\_end] for which you should not create slots? This could make the script more complex to code
- There are multiple ways of setting and running your script, as you can see [in the documentation](https://seatable.com/help/skript-manuell-per-schaltflaeche-oder-automation-ausfuehren/). My preference goes to execute it via a button or an automation depending on your needs
- Depending on whether you want to systematically create time slots for both timeslot\_types simultaneously or if you prefer to be able to create time slots for only one timeslot\_type, you will respectively either click a button in another “command” table or create a button column in your “timeslot\_types” tables so you’ll be able to run the script for each row (meaning each timeslot\_type) independently.
- Whatever your choice, I advise you to create, in the same table as the button column, two date columns[date\_start] and [date\_end] , which will make the execution of the script more flexible than if you hardcode (write directly in the code) the dates, plus you won’t have to deal with date formats in the code
- Last but not least, here is how the code might work (for one single timeslot\_type):
  - For each day between the values of your [date\_start] and [date\_end] columns for the current row:
    - For each slot between 1 an the value of `slots_daily` for the current row:
      - populate an initially empty `rows_data` array (only setting `time_slot_date`)

  - [Batch create the rows](https://developer.seatable.com/scripts/python/objects/rows/#add-rows) with `base.batch_append_rows` and store the result in a `created_rows` variable
  - For each row in your `created_rows` variable:
    - Feed both a `row_id_list` and a `other_rows_ids_map` needed for the `base.batch_update_links` function (see just below)

  - [Batch create the links](https://developer.seatable.com/scripts/python/objects/links/#batch-update-links). If you don’t want to bother with links, you could define a text column like `slot_code_name` in your “timeslots table”, enter the `slot_code` value when creating the rows, and define an automation triggered by new lines that will auto link a “timeslots” row with a “timeslot\_types” row by comparing `slot_code_name` (from “timeslots”) and `slot_code` (from “timeslot\_types”)

Hope this helps…

Bests,  
Benjamin
