Can we increase the limit of 10 for listed columns to more? if so how?

We are trying to use the Python API and querying the data from Seatable directly.

We are able top access the data, but any listed column with more than 10 cases is capped to 10 and we do not see in the documentation how to change that to more elements.

The documentation state the following:

When a list column is returned in a selected field, only the first 10 elements are returned.

From : SQL Reference - SeaTable Programming Manual

When listing rows, the returned links are limited to 10 to avoid performance issue.

To get more links for specific rows by calling link API: List Row Links

Hi Daniel, I am not sure I undersand what we are expected to do.

Let’s say we are query all data from a table, and one column contains list that exceed the 10 limit.

How can I increase such limit (return more links using your own wording).

If you can show a simple SQL example will be much appreciated

According to the documentation you shared, the limit parameter can be edited to retrieve more than 10 records per row, where can that be changed on our end? this is the code we use to run the query:

base = Base(api_token, server_url)
questions= base.query(‘select * from Questions limit 100000’)

I don’t quite understand the terms you use. Maybe a screenshot is better.

Do you mean you have a link column that containing more than 10 links, and you can only see the first 10 links?

Yes, the column has more than 10 elements within the same row, and hence only the first 10 elements are returned.
Would a screenshot of the json file help? on what do you need a screenshot?

If you have more than 10 links in a column named “sample_link_column”, you can get the more links using the API call

link_column_id = base.get_column_link_id('your_table_name', 'sample_link_column')
row_id_1 = question[0]._id
row_id_2 = question[1]._id

base.get_linked_records('your_table_name', link_column_id, rows=[
        {'row_id': row_id_1, 'limit': 2, 'offset': 0},
        {'row_id': row_id_2, 'limit': 20}

You can check the document at: Links - SeaTable Programming Manual

I am trying to replicate your proposal for the Indicator table

# that return a json file with a single file as ID is a unique identifier
indicators = base.query('select * from Indicators where ID = "L2.1.1a" limit 100000') 
# get the column id of the column named 'Question(s)
link_column_id = base.get_column_link_id('Indicators', 'Question(s)')
# get the row id value
id_value = indicators[0]['_id']
# get the records for the Indicator table the the desired row for a maximum of 20 records
base.get_linked_records('Indicators', link_column_id, rows=[
        {'row_id': id_value , 'limit': 20}
#I get the following error:

ConnectionError: [Errno 500] {"error_message":"internal server error"}

# for the record, I am able to query the table without any problem

Hello, please notice that the params for function get_linked_records should be table_id and link_column_key instead of table_name and link_id(which is totally different from link_column_key). So the code should somehow write like this:

# get the column id of the column named 'Question(s)
table_name = 'Indicators'
column_name = 'Question(s)'
# get column key and table_id from base metadata
metadata = base.get_metadata()
tables = metadata['tables']
# get the table first
table = [table for table in tables if table['name'] == table_name][0]
# get column from the table
columns = table['columns']
column = [col for col in columns if col['name'] == column_name][0]

table_id = table.get('_id')
column_key  = clolumn.get('key')

# then get the link records
base.get_linked_records(table_id, column_key, rows=[
        {'row_id': id_value , 'limit': 20}

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