Hello!
I’m trying to add a row to a table using python, like this:
#Adding a new
row_data = {
'Organizer': ['JTP06oYrREypDLBxyzmBqQ'],
'Event start': '2023-17-05 10:00',
'Technical support': 'Required'
}
base.append_row('Applications board room', row_data)
but due to the fact that the columns to which I add values have the type: “Date”, “Single selection” and “Link to other records”, the values in my table turn out to be empty.
Help to make a query to the table correctly so that you can add records to these columns!
I don’t understand your decision…
When I specify the date ‘2023-17-05 10:00’ to the column with the “Date” type, then the row where the date should be displayed is empty.
With links to other records, it is even more unclear where to find the “Link Table Identifier”? And where can I see the “Link column Key”? I only see the API token, but that’s not what I need
I did it all
Now, when executing the script, a new row appears in the table. In this line, all fields are filled in, except for the “Organizer” field, which has the “Link to other records” type.
How do I fill in this field?
please tell me what’s wrong? I do everything according to the instructions
from seatable_api import Base, context
server_url = 'https://seatable.my_address.com '
api_token = 'TOKEN'
base = Base(api_token, server_url)
base.auth()
rows = base.list_rows('Collegium hall')
base.add_link('Organizer', 'Employees', 'Collegium Hall', 'L4HosWGZQyWxLQzz-j1EhQ', 'P7fq-xF9RBKNG2bfByhmFA')
base.update_link('Organizer', 'Employees', 'Collegium hall', 'L4HosWGZQyWxLQzz-j1EhQ', ['P7fq-xF9RBKNG2bfByhmFA'])
row_data = {
'Event start': '2023-05-17 10:00',
'Technical support': 'Required',
'Duration': 7200,
'Describe the event': 'This is a test record'
}
base.append_row('Applications of the collegium hall', row_data)
but I get an error:
raiseConnectionError(response.status_code, response.text)
Connection Error: [Errno 400] {"error_type":"table_not_exist","error_message":"table Employees or Collegium hall not found"}
I do not want to sound sarcastic, but which part of this error message don’t you understand? Without knowing a thing about your base, I can see the problem right away: “Collegium hall” is not the same as “Collegium Hall”.
Additionally, you keep ignoring my and @AkDk7’s advice. I told you and he seconded that you have to create the row first and then add the link.
So you have to get the link_id (Links - SeaTable Programming Manual) of the linked column, add the new row id and the put the row id of the related record from the other table into the array of other_row_ids.
If you did everything correct, it should update the value.