I’m trying to update 2 dropdowns using value from a datatable (single selection only), upon a row been selected. I’m running into error after selecting the row. I’m wondering if I am not using the “selected_rows” property right.
The error msg is “TypeError: list indices must be integers or slices, not NoneType”. Which suggest the value of selected_rows is empty. My table looks like the below.
Column name is correct as when i substitute selected_rows with a number, eg 1, the code works.
I solved it. Turned out the selected_row was returning a list where I thought it was an integer. So instead of
dropdown1=data[selected_rows][‘column1’]
I had to change it to
dropdown1=data[selected_rows[0]][‘column1’]