Delete single row from linked table and original table

My group and I are attempting to use a delete function that will delete one row from a linked “checked-in” table as well as delete the appointment from the original table. Right now, our check-out button is deleting every row in the linked table and not deleting anything from the appointment table.

We’ve tried to create a cascading delete function in the server, but that seems to be the issue in the number of rows it is deleting. This is the code for it:

@anvil.server.callable
def cascade_the_delete():
  for checkingtable_row in app_tables.checking.search():
    try: 
      checkingtable_row['appointmenttable_row']['name']
    except anvil.tables.TableError:
      checkingtable_row['name'] = None
  if app_tables.checking.search(name=None):
    row = app_tables.checking.delete_all_rows()

If this doesn’t make sense, I can provide a clone link with the logging in information.

Thanks.