How to get a value from selected row on a table?

I have an exisitng table with "single" selection enabled. When I select a row,
filtered_data := mo.ui.table(result, selection="single", show_column_summaries=False)
print(filtered_data.value)
partid year price
1 60441-1 2024 31.99
1 60441-1
print(filtered_data.value['partid'])
1 60441-1
print(filtered_data.value['partid'][1])
60441-1
filtered_data := mo.ui.table(result, selection="single", show_column_summaries=False)
print(filtered_data.value)
partid year price
1 60441-1 2024 31.99
1 60441-1
print(filtered_data.value['partid'])
1 60441-1
print(filtered_data.value['partid'][1])
60441-1
How do I get the partid of the selected row? I don't know in advance what index number of that row is?
Solution:
i solved with
filtered_data.value['partid'].values[0]
filtered_data.value['partid'].values[0]
Jump to solution
1 Reply
Solution
Brickwit (David)
i solved with
filtered_data.value['partid'].values[0]
filtered_data.value['partid'].values[0]