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.
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)
base.auth()
questions= base.query(‘select * from Questions limit 100000’)
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?
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}
])