**What I’m trying to do:
I am trying to capture data into my data table, but am missing something somewhere. my postal_code_2 has been instantiated, the data table column is set as text, but i keep on getting this error upon running my function:
anvil.tables.TableError: Column ‘postal_code_2’ is a string - cannot set it to a simpleObject
called from /libanvil/anvil/_server.py, line 41 called from [ServerModule1, line 47](javascript:void(0)) called from [add_account, line 52](javascript:void(0))
What I’ve tried and what’s not working:
Renamed the table column, class and input field
Code Sample:
def button_8_click(self, **event_args):
"""This method is called when the button is clicked"""
acc_no = ""
surname = self.surname_box.text
initials = self.initials_box.text
title = self.title_box.text
full_names = self.fulle_names_box.text
id_number = self.id_no_box.text
cell_no = self.cell_no_box.text
tel_no_h = self.tel_no_h_box.text
tel_no_w = self.tel_no_w_box.text
email_address = self.email_address_box.text
street = self.street_name_box.text
suburb = self.suburb_box.text
town_city = self.town_city_box.text
postal_code_1 = self.postal_code_box.text
po_box = self.po_box_box.text
po_box_suburb = self.po_box_suburb_box.text
postal_code_2 = self.postal_code_box_2.text
medical_aid = self.medical_aid_drop.items
medical_aid_option = self.medical_aid_drop.items
medical_aid_no = self.member_number_box.text
dependant = self.dependant_box
anvil.server.call('add_account', acc_no, surname, initials, full_names, title, id_number, cell_no, tel_no_h, tel_no_w, email_address, street, suburb, town_city, postal_code_1, po_box, po_box_suburb, postal_code_2, medical_aid, medical_aid_no, medical_aid_option, dependant)
Notification("Account added").show()
self.clear_inputs()
Clone link:
share a copy of your app