Thanks @Tony.Nguyen. My temporary fix was indeed something like this…
@anvil.server.callable
def get_index(price):
index = 0
for row_product in app_tables.products.search():
if row_product['price'] == price:
return index
index += 1
return 0
Which gets me the first index with this condition satisfied. However, my feeling was that there might be something built in already with the get function of a row that is more elegant.
I have also been in the need of some kind of incrementer. I basically need to flip through and display my data table one row at a time. The only way I could figure out how to get the “next” row from the current row was by keeping track of the row index and grabbing rows with app_tables.products.search()[index]
PS the example shows me check for floats by equality. This is just an example and not what I am actually doing.