I'm new for Retool and after I tried that query and it work but after I restart my laptop or leave it for long time (1 hr++) it'll be error (undefined is not an object (evaluating 'table.selectedRow.data.id') as the image. it use to happen with me for 2 times, what should I do. i tried to check any connection but there is no problem
Hi Kamon!
I'm happy to walk you through solving this issue.
This problem appears when there is no row selected in table1. When there is no table selected, the query breaks.
Lets modify your query to guard against this.
SELECT contacts.name, contacts.role, contacts.email, contacts.linkedin
FROM contacts
WHERE {{!table.selectedRow.data.id}}
OR contacts.company[1] = {{table.selectedRow.data.id}}
This will change the query so that when no user is selected, all users are shown instead.
For more information, check out our documentation on tables here: https://docs.retool.com/docs/data-in-tables
If there is anything else I can assist you with, please let me know!\