You can do great things in SeaTable with a script. However, nothing happens by saving alone: in fact, the execution of the script must be started either manually, by button or by automation.
In this article, we will introduce you to these three different possibilities. The article assumes that you have already created a first script in your Base, which in our example does nothing but output Hello World.
Run script manually
- In your Base, click in the Base header.
- Hover the mouse over the name of your script.
- Start the script with the play icon .
Execute script via a button
- Create a column of the type Button.
- Decide which label and color you want the button to have.
- Use the Run Script action.
- Select your script and save.
From now on, every time you click the button, your script will be executed. Within the script, you can access the values of row by calling context.current_row. Of course, you can also access all other rows via the rows-ID or by using a loop.
Run script via automation
You can use an automation to run a Python script. JavaScript is not available to you at this point because JavaScript is executed in the user's browser, which is not available in an automation.
- In the Base header, click and then click Automation Rules.
- Click Add rule and create a new automation. You can get more detailed information on how to do this here.
- Use the Run Python Script automation action.
- Select your script and save the automation with Submit.