> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://documentation.celestory.io/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# ⬜ Airtable

# ⬜ Airtable

![Airtable](https://celestory-docs-illustrations.netlify.app/en/Airtable_EN.svg)

The Airtable block allows you to connect your Celestory project to an Airtable database to read, modify, add or delete data. It is particularly useful for managing structured information such as player scores, inventories or contact lists directly from an online spreadsheet.

In practice, this block can create a new row, read an existing one, modify it, or delete it (these four actions are commonly called "CRUD", for Create/Read/Update/Delete) — much like having Celestory fill in or look up your Airtable spreadsheet on your behalf.

## 📥 Entries

- in (Trigger): Triggers the execution of the block. Must be linked to a previous block to activate the action.
- config (Object): Main configuration of the block, including:
- Base: Name of the Airtable workspace containing your database.
- Table: Name of the specific spreadsheet (table) to use.
- Operation: Action to be performed among:
- Read: Retrieves data (requires an id or a query).
- Create: Adds a new line with the values provided.
- Update: Modifies an existing line (requires an id).
- Delete: Deletes a line (requires an id).
- id (String): Unique identifier of an Airtable row (required for Update and Delete operations).
- query (String): Filter formula for the Read operation (ex: Name = 'Pierre'). Used if no id is provided.
- [Column Names] (Dynamic): Dynamic fields corresponding to the columns of your Airtable table, appearing automatically for Create and Update operations. Allow you to define the values to insert or modify.

## 📤 Outings

- out (Trigger): Activates when the operation with Airtable is successfully completed.
- onError (Trigger): Activates in case of error (connection failed, ID not found, etc.).
- id (String): Unique identifier of the created row (available after a Create operation).
- [Field Names] (Dynamic): Dynamic outputs corresponding to the columns of your Airtable table, available after a Read operation. Allows access to the recovered data (text, number, etc.).

## 💡 Example of use

Scenario: Update a player's score in a game

1. A player finishes a game and gets a new score of 1500 points.
1. You want to save this score in your Airtable database, which already contains a row for this player (identified by his id).
1. Add an Airtable block to your graph and configure it as follows:

- Base: MyGame
- Table: PlayerScores
- Operation: Update
- id: rec123456789 (player row ID in Airtable)
- Score: 1500 (plug in the variable containing the new score here)

1. The block updates the corresponding row in Airtable with the new score.
1. If the update is successful, the flow continues through the out output to display a confirmation message to the player. In the event of an error, the onError output is activated to handle the problem (eg: display an error message).

## ⚙️ Technical Details

- Dynamic variable management: The inputs and outputs corresponding to the columns of your Airtable table are dynamically generated according to the block configuration. These fields appear automatically after selecting the Base and the Table.
- API key: The Airtable API key must be configured beforehand in the Integrations menu of Celestory. Without this key, the block will not be able to communicate with your database.
- Data format: Data types (text, number, boolean, etc.) are automatically mapped between Celestory and Airtable. Make sure the values provided match the types expected by your table.
- Limits: The Read operation only ever returns a single row at a time (the first one found), even without an id or a query — it cannot be used to fetch an entire table in one block. Use query to target the exact row you need, otherwise the first row of the table is returned.

---

*Documented version: v1*
