** Question **
Please send me the link to the documentation telling me the answer to this question:
What happens when the row id is not in the table?
app_tables.tablename.get_by_id(id) What I’ve tried and what’s not working:
Searching google and anvil.works docs What I found:
get_by_id(id) → row
Get the matching row from this data table, by its unique ID
Hi,
I am sending a row_id from the client to the server. I want to check that the id is valid. What happens when it is not valid? I could not find this information in the documentation…
regards
Ben
This is one of those questions that’s super easy to test yourself, just by writing code that uses an invalid id and printing the result. Off the top of my head, I’d assume it returns None (and have written code based on that assumption), but I’m not sure where I read that.
You will get an error that no row was found with this id (Don’t remember the exact words though)
As simple as that. You can use the try/except blocks to handle this situation