User Management - Make App or Portal Data Filter Based Upon User's Company

I want to create a standard app that multiple customers can use but only show/interact with the relevant data for that customer which is their company_id.

How do I associated company_id with a user? and then filter every interaction they have on the app to reference that variable?

WHERE company_id = {{ company_id }}

Hey @ryanrunchey, my first thought is to have a table in a db (RetoolDB etc) that links the customer by email to the appropriate customer id. You can run that query first to get their company_id, then run any subsequent queries with that id. You can use current_user global variable to find their email and kick off the initial query.

Screenshot 2023-10-06 at 2.06.09 PM