Hi everyone,
I’m working on a Frappe Insights setup and need help implementing role- and department-based filtering for Number Cards.
Use Case:
I have multiple departments like:
- Housekeeping
- IT
- Maintenance
For each department, I’ve created separate Number Cards in Insights, such as:
- Housekeeping Tickets
- IT Tickets
- Maintenance Tickets
The goal is:
When a supervisor logs in, they should only see the number cards relevant to their department.
Example:
- If a user belongs to the Housekeeping department they should only see Housekeeping Open Tickets.
If a user belongs to the Maintenance department they should only see Maintenance Open Tickets. - Admins or managers should see all departments.
Current Challenge:
- Right now, all users can see all the Number Cards, regardless of their department.
- I need a way to filter dashboards automatically based on the logged-in user’s department, without manually creating separate dashboards for each user.