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 Automate / Filter Lookup Column t...
Power Automate
Suggested Answer

Filter Lookup Column to Show Only “Parent” Documents in SharePoint List Form

(0) ShareShare
ReportReport
Posted on by 65

Hi everyone,

I have a SharePoint list called Master Documents Register.

Inside another list, I created a lookup column named Parent Document that points to this Master Documents Register list.

What I need

When editing or adding a new item, the Parent Document dropdown should show only Parent documents, not Child documents.

 

Document Code formats:

Parent document format:

[Department]-[Type]-[Sequential Number]
Example: CS-PRO-045

 

Child document format:

[Parent Number]-[Child Sequential#]

Example: CS-PRO-045-001

The key difference is that parent codes have exactly 2 hyphens (“-”) while child codes have 3.
 

What I Tried

I attempted to use JSON column/field formatting like this:

{
  "$schema": "https://developer.microsoft.com/json-schemas/sp/v2/column-formatting.schema.json",
  "elmType": "div",
  "style": {
    "color": "=if(length(split(@currentField,'-')) == 4,'green','red')"
  },
  "children": [
    { "elmType": "span", "txtContent": "@currentField" }
  ]
}
 

and conditional formulas such as:

=if(length(split([$ParentDocument], "-")) == 4, true, false)

But this only changes how the value is displayed after selection—it does not filter the lookup dropdown.

 

Categories:
I have the same question (0)
  • Suggested answer
    developerAJ Profile Picture
    4,763 on at
    As you mentioned, column formatting in SharePoint only affects the UI and cannot filter lookup columns. Currently, there’s no native way to restrict a lookup dropdown to certain values. The two practical approaches are: create a separate list to maintain only parent documents or customize the form using Power Apps to filter the lookup dynamically.
     

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn || 📘 Explore more on my articles

     
  • asit00 Profile Picture
    65 on at
    Hi developerAj 
     

    I created a document library, and inside it, I have departments. Now, when I upload a document, I want to create a document number. In my opinion, I will store all parent documents in the list, but based on the department, how can I select a specific document? Can you tell me if you have any idea?

    For example: CS-PRO-045

    When I go to the Computer Science folder, I want it to only show codes starting with CS-

  • developerAJ Profile Picture
    4,763 on at
    In your initial question, you mentioned a SharePoint list, but now you’re referring to a document library, so I’m not entirely sure what you’re looking for. If you’re working with a document library where all documents are in the root folder (with no subfolders), one option is to use a column and create a view so the documents are grouped by the column you choose. For example, if you have a Department column in the library and populate it with the respective department, you can use group by. However, the grouping will not appear like a traditional folder structure.
     
     
  • developerAJ Profile Picture
    4,763 on at
    If this is not what you’re looking for, could you explain your scenario in more detail — specifically, what the SharePoint list does in your case and how you’re leveraging the document library? For example, do you store the files in the library and then reference them in the SharePoint list?
  • developerAJ Profile Picture
    4,763 on at

    Please let us know if the issue still exists. If it has been resolved, kindly close the thread by accepting the solution

     

    If this solution helped you resolve your issue, kindly mark it as accepted — it makes it easier for others to find and also closes the discussion. If you found it useful, a Like ❤️ would be greatly appreciated!

    🤝 Let’s connect on LinkedIn || 📘 Explore more on my articles

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 997

#2
Valantis Profile Picture

Valantis 810

#3
Haque Profile Picture

Haque 642

Last 30 days Overall leaderboard