I linked my Appsmith application to SQL Server data source which contains all company sales, I have branches and each branch have one user account
I need to filter the data table in application to show only the sales which related to the current user to prevent branch from seeing other branch sales
You can write logic to use the current user’s information by accessing {{ appsmith.user.email }}
Thanks Nikhil for your reply
I success to get the user mail with your recommended code but I failed to run if else statement so I can filter the data table depending on user mail
attached photo from my table and I need to filter the data on it using user mail and InvWh column so each user can see only the data for specific InWh
I hope you can help me doing this
@a.adel you should send the email to your SQL query
as
Select * from <Table> where email = {{appsmith.user.email}}
You need to write it in the query that fetches the data - this would be the Invoices
query - so that it will filter the data by the email
column.