I have a table (“Mock Exam Questions”) that is grouped by a column that has links to another table (“Mock Exams”):
When I use the API to get the linked records from the linked “Mock Exams” table, everything looks as expected:
In [39]: from seatable_api import Base
...:
...: seatable_api_key = "<obfuscated>"
...: table_name = "Mock Exams"
...: link_column_name = "Questions"
...:
...: base = Base(seatable_api_key, "https://cloud.seatable.io/")
...: base.auth()
...: table = next(t for t in base.get_metadata()["tables"]
...: if t["name"] == "Mock Exams")
...: table_id = table["_id"]
...: link_column_key = next(c for c in table["columns"]
...: if c["name"] == link_column_name)["key"]
...:
...: exam1, exam2 = base.list_rows(table_name)
...:
...: base.get_linked_records(table_id, link_column_key, [{"row_id": exam1["_id"]}])
...:
Out[39]:
{'M2YwSE8sSoery3RJPIaSaQ': [{'row_id': 'ARF3RMtGRM-Sc-qGPQwHag',
'display_value': 'test 1'},
{'row_id': 'WAfxXBsjRUmb6KwRA9bHDw', 'display_value': 'test 2'},
{'row_id': 'Hb4K8NYSQ--6XIc_SX5dPg', 'display_value': 'test 3'},
{'row_id': 'FupUX9dPSEWbKeiWpJ2uvg', 'display_value': 'test 4'}]}
In [40]: base.get_linked_records(table_id, link_column_key, [{"row_id": exam2["_id"]}])
...:
Out[40]:
{'a7mW2vHtTzqMZpJKT9RBGA': [{'row_id': 'Am25fDEWR76jJObqGXCSbA',
'display_value': 'test 5'}]}
When I now use the GUI to drag rows from the “Mock Exam 1” group to the “Mock Exam 2” group, the link in the “Mock Exam” column gets updated accordingly:
However, the results of base.get_linked_records
have not changed:
In [41]: base.get_linked_records(table_id, link_column_key, [{"row_id": exam1["_id"]}])
...:
Out[41]:
{'M2YwSE8sSoery3RJPIaSaQ': [{'row_id': 'ARF3RMtGRM-Sc-qGPQwHag',
'display_value': 'test 1'},
{'row_id': 'WAfxXBsjRUmb6KwRA9bHDw', 'display_value': 'test 2'},
{'row_id': 'Hb4K8NYSQ--6XIc_SX5dPg', 'display_value': 'test 3'},
{'row_id': 'FupUX9dPSEWbKeiWpJ2uvg', 'display_value': 'test 4'}]}
In [42]: base.get_linked_records(table_id, link_column_key, [{"row_id": exam2["_id"]}])
...:
Out[42]:
{'a7mW2vHtTzqMZpJKT9RBGA': [{'row_id': 'Am25fDEWR76jJObqGXCSbA',
'display_value': 'test 5'}]}
This look like a bug?
Side note: when I tried to move rows using the GUI after typing this up to check one more time, the browser window turned completely blank as soon as I started moving the mouse, and this problem persisted even after refreshing.