web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Custom Views on Specif...
Power Pages
Suggested Answer

Custom Views on Specific Folders

(1) ShareShare
ReportReport
Posted on by 2
I have different folders in a common /documents folder, and I was wondering if there's a way to create a view that only applies to a specific folder? If I press on the HR folder then a different view shows up than compared to IT. How should I go about doing that?
Categories:
I have the same question (0)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,834 Super User 2026 Season 1 on at
     

    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:


    Option 1: Use Metadata Columns (Recommended)

    This is the most flexible and user-friendly method.

    Steps:

    1. Add a metadata column (e.g., "Department") to your document library.
    2. Tag each folder or file with the appropriate value (e.g., HR, IT).
    3. Create a custom view for each department:
      • Go to the document library.
      • Click "Create view".
      • Set a filter: Department is equal to HR.
      • Save the view as "HR View".
    4. Use Power Automate or a script to auto-tag files based on folder path (optional but helpful).

    Result:

    When users navigate to the HR folder, you can use Power Automate or custom scripting to redirect them to the "HR View".


    Option 2: JSON View Formatting (Advanced)

    You can use JSON to conditionally format views based on folder name.

    Example:

     

    {

      "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.


    Option 3: Power Pages or Power Apps Integration

    If you're building a custom UI (e.g., Power Pages), you can:

    • Use the folder path as a filter in your Dataverse or SharePoint connector.
    • Dynamically load different views based on the folder selected.

    🏷️ 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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Pages

#1
DP_Prabh Profile Picture

DP_Prabh 51

#2
rezarizvii Profile Picture

rezarizvii 35

#3
oliver.rodrigues Profile Picture

oliver.rodrigues 33 Most Valuable Professional

Last 30 days Overall leaderboard