Skip to content

Context

When the script is running in the cloud, the context object provides a context environment. Here's how to use it

server_url

server_url

Server URL, used to initialize Base.

context.server_url

Example

from seatable_api import context
print(context.server_url)

api_token

api_token

API token for access a base.

context.api_token

Example

from seatable_api import context
print(context.api_token)

current_table

current_table

The name of the table that the current user is viewing when the user runs a script manually.

context.current_table

Example

from seatable_api import context
print(context.current_table)

current_row

current_row

When the user manually runs a script, the line where the cursor is currently located.

context.current_row

Example

from seatable_api import context
print(context.current_row)

current_username

current_username

The System ID of the user who runs the script manually (in old verison, it is called current_user_id).

context.current_username

Example

from seatable_api import context
print(context.current_username)

current_id_in_org

current_id_in_org

The id of the user in the team, it can be set by the team admin via Web UI.

context.current_id_in_org

Example

from seatable_api import context
print(context.current_id_in_org)