Python: base.list_rows() does not return all columns

Hi,

trying to get some of my data out of seatable with a small python script (based on this example). I have a table with around 13 columns of different type(s). When i run my python script, i can successfully authenticate and get some rows. But, when i debug and look into a single row, i can only see around 5 columns + the 3 internal columns. I stumbled upon this, because i wanted to get all my tags (german: “Schlagworte”) from a column. I thought this might be a restriction of a column type (like no single-select), but i could see the “Status” column, which is also a single-select column.
Is there any limitation, that i’m not aware of? I’m using the free cloud version of SeaTable.

BR,
Michael

Hi @mfreudenberg.

What data type are the missing columns of?

Hi,

there are all sorts of data types. I have

  • duration
  • number
  • link (to other tables)
  • url
  • image
  • file attachment
  • multi select

Just by writing this, i realizedy that single-select columns are returned by base.list_rows() but not multi-select like “tags”. Still wondering if there is a limitation in the api in regards to the column types.

And the values for these column types are not returned?

No the colums itself (properties) are not returned. When i loop over all rows and examine a single row in the debugger, i can only see the 5 mentioned columns (properties). The other 8 with the mentionend type above are not there, when i examine them while debugging. If i try to access a non-existent property (like for example st_rows["Stichworte"]), the script stops on that line. First i thought i had a typo until i examined the row in the debugger.

I tried it myself and I cannot see any problems.

Having this table:

Executing this python script:

from seatable_api import Base, context

server_url = context.server_url or ''
api_token = context.api_token or ''
base = Base(api_token, server_url)
base.auth()

rows = base.list_rows('Workdays')
print(rows)

Returns:

[{
        'WorkdaysThisMonth': 23,
        'Zeit': 43200,
        '_locked_by': None,
        '_creator': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'Name': None,
        'Year': 2023,
        '_locked': None,
        '_last_modifier': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'FirstDayWeekdayNumber': 1,
        'WorkdaysThisMonth2': 22,
        '_mtime': '2023-03-12T08:37:02Z',
        '_id': 'AkFr9fwtS9WFy62x3Uvufg',
        '_ctime': '2023-01-31T18:25:29.459Z',
        'Month': 1,
        'TotalDaysThisMonth': 31,
        'Image': None,
        '_archived': False
    }, {
        'FirstDayWeekdayNumber': 3,
        'WorkdaysThisMonth2': 23,
        '_mtime': '2023-03-12T08:37:00Z',
        '_id': 'c5tHVqFOTz-WG3fSkIbC0w',
        'Month': 11,
        'TotalDaysThisMonth': 30,
        'Image': None,
        '_archived': False,
        '_ctime': '2023-01-31T18:34:08.677Z',
        'WorkdaysThisMonth': 22,
        'Zeit': 0,
        '_locked_by': None,
        '_creator': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'Name': None,
        'Year': 2022,
        '_locked': None,
        '_last_modifier': 'e5ad4d695d36416f964257b0915fdb0e@auth.local'
    }, {
        'WorkdaysThisMonth': 20,
        'Zeit': None,
        '_locked_by': None,
        '_creator': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'Name': None,
        'Year': 2023,
        '_locked': None,
        '_last_modifier': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'FirstDayWeekdayNumber': 4,
        'WorkdaysThisMonth2': 21,
        '_mtime': '2023-01-31T18:34:20.955Z',
        '_id': 'N-81OC8vR1-bOIqbMPdBJg',
        'Month': 2,
        'TotalDaysThisMonth': 28,
        'Image': None,
        '_archived': False,
        '_ctime': '2023-01-31T18:34:09.402Z'
    }, {
        'Year': 2024,
        '_locked': None,
        '_last_modifier': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'Name': None,
        'WorkdaysThisMonth2': 24,
        '_mtime': '2023-01-31T18:34:26.877Z',
        '_id': 'QqOmCUvwQsacREDkNuqE4A',
        'FirstDayWeekdayNumber': 4,
        'TotalDaysThisMonth': 31,
        'Image': None,
        '_archived': False,
        '_ctime': '2023-01-31T18:34:10.054Z',
        'Month': 5,
        'Zeit': None,
        '_locked_by': None,
        '_creator': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'WorkdaysThisMonth': 22
    }, {
        '_archived': False,
        '_ctime': '2023-01-31T18:34:30.955Z',
        'Month': 2,
        'TotalDaysThisMonth': 29,
        'Image': ['https://???/workspace/3/asset/007466bc-b4d0-4190-bce3-a1d2a933293d/images/2023-03/Carpet2.png'],
        '_creator': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'WorkdaysThisMonth': 20,
        'Zeit': 55980,
        '_locked_by': None,
        '_last_modifier': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'Name': None,
        'Year': 2020,
        '_locked': None,
        '_id': 'XhAdD9V_ReuteQgZbtYVSg',
        'FirstDayWeekdayNumber': 7,
        'WorkdaysThisMonth2': 21,
        '_mtime': '2023-03-12T08:36:58Z'
    }, {
        '_creator': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'WorkdaysThisMonth': 20,
        'Zeit': None,
        '_locked_by': None,
        '_last_modifier': 'e5ad4d695d36416f964257b0915fdb0e@auth.local',
        'Name': None,
        'Year': 2021,
        '_locked': None,
        '_id': 'ZBOxVKybTPiU-yOXAcJWAw',
        'FirstDayWeekdayNumber': 2,
        'WorkdaysThisMonth2': 20,
        '_mtime': '2023-01-31T18:34:58.381Z',
        '_archived': False,
        '_ctime': '2023-01-31T18:34:56.162Z',
        'Month': 2,
        'TotalDaysThisMonth': 28,
        'Image': None
    }
]

I’ll post my code later on. Currently, i’ m busy with parental stuff :smile:

1 Like

So as it seems, I have found the problem, which was in front if the screen.

When there is no value in a cell, the API does return neither a value nor a property. Which means, i basically just need to check if the value is null. Currently, i’m doing that by list comprehension in python:

general_tasks = base.list_rows('Aufgaben', 'Allgemein', limit=0)
st_tasks_with_tags = [st_task for st_task in general_tasks if 'Schlagworte' in st_task.keys() ]

Where

1 Like

Oh, yes. I didn’t think of that problem. :slight_smile:
Good you found it out!

1 Like

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