I am creating a time and attendance application. I used the template. The app will allow a contractor to add his employees and when they arrive at work, their time will be recorded. This works fine until I add another contractor. How do I restrict the contractors from seeing only their data.
I have a table call team with id, name, email columns… (the email column is the user who will login in)
I also have an employee table with empid, name, company
I followed the documentation and tried this filter.
IN(Employees [Company], SELECT(Team [Id], [emailaddress] = USEREMAIL()))
What I am trying to do is to for the user that is logged in to see only the employees that are in his company.
I must mention that as a ref it is working from the teams view. I want to filter the employees view.
I want only contractors to see their data. The contractor will login to the system. I created a team page. From that page it was simple to filter the record by useremail() asthe team table has a column for email. This view allows the associated employees to show via a ref_row. The problem is when I go to the employee view via the menu, the contractor can see all employees. I want them again to see only their employees. In the employee table there is a relationship between the employee and team using the companyID. I need to filter by the email and companyID of the login contractor on the employee table. I can then use the same expression on the timesheet table.
When you have the security filter with your Team table as USEREMAIL()=[Email], it will filter your table and the result is probably only one record. Then you can filter your Employee table like IN([companyID],Team[ID])
Side suggestion: Maybe someone could make a good demo application that shows how to make an staffing app combine with different security levels/policies? I see someone else has a similar query:
[Selection of types of employees](https://community.appsheet.com/t/selection-of-types-of-employees/25165) Questions
I have 2 tables, one contains information of employees, (id, Name and Employee position), the other table is supervision, related by the column ID of the table employees and the column employee in the table supervision. I need to select only one type of employee. I need one list of one type. How do i do it?
it suggests there is a absence of documentation and examples over what might be a rather standard set of features used in organization that is using Appsheet for its solutions.
Hmm, this sounds like a interesting challenge. I might take it up later tonight or tomorrow.
aucforum:
Side suggestion: Maybe someone could make a good demo application that shows how to make an staffing app combine with different security levels/policies?