
Announcements
Yes, you can create folder-specific views in a SharePoint document library (like /documents/HR or /documents/IT) using metadata filtering or JSON view formatting. Here's how you can approach it:
This is the most flexible and user-friendly method.
Department is equal to HR.When users navigate to the HR folder, you can use Power Automate or custom scripting to redirect them to the "HR View".
You can use JSON to conditionally format views based on folder name.
{
"schema": "https://developer.microsoft.com/json-schemas/sp/view-formatting.schema.json",
"hideColumnHeader": true,
"rowFormatter": {
"elmType": "div",
"style": {
"display": "=if([$FileDirRef] == '/sites/yoursite/Shared Documents/HR', 'block', 'none')"
},
"children": [
{
"elmType": "span",
"txtContent": "[$FileLeafRef]"
}
]
}
}
This hides rows that don’t belong to the HR folder.
If you're building a custom UI (e.g., Power Pages), you can:
🏷️ Tag me if you have any further questions or if the issue persists.
✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems.
❤️ Give it a Like if you found the approach useful in any way.