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 Apps / Filter by Custom Field...
Power Apps
Unanswered

Filter by Custom Field on SharePoint Doc Library

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I've added a Boolean field to my SharePoint Document Library called 'IsProject' and set it to true for one folder.

I'm then trying to load just this record into my app using the following filter:

 

Filter(Documents,IsProject=true)

 

This filter returns no results even though there is one folder that fits the criteria.

If instead I first load all documents into a collection and then use the same filter, this works. For example:

 

//Collect Button
ClearCollect(DocCollection,Documents)

//Gallery Items
Filter(DocCollection,IsProject=true)

 

I'm trying to avoid loading everything into a collection first and want to do the query directly on SharePoint.

Anyone have any ideas?

 

Sam

Categories:
I have the same question (0)
  • Rohit Sharma354 Profile Picture
    Microsoft Employee on at

    Hello,

     

    Instead of true use 1 as shown below. This should work.

     

    Filter(Documents,IsProject=1)

     

     

     

  • WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    Hi @Anonymous ,

    The issue is that a Boolean (true/false) query, even though the documentation says is Delegable, does not seem to function on large datasets. I always use collections like you, or have now resorted to text fields with ["","Yes","No"] coded into the Items of a drop down in PowerApps. The Text field search is then fully delegable. Another way if all the records are in the newest 2000 items is to set your limit to this and then

    ClearCollect(
     YourColName,
     Sort(
     YourListName,
     ID,
     Descending
     )
    )

    and then (as you know), your query will work as you need.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @rohsh354 

    Thanks, this works but I'm now getting this warning on the field (even though it's working fine):

    2020-06-06_1313.png

    Can you also refer to what @WarrenBelz mentioned above? Will this query be delegable?

    According to this update here it should be: https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/

     

    Thanks

    Sam

  • WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    @Anonymous ,

    Not sure who you are responding to here.

    Yes - you will get a Delegation warning on Boolean fields, hence my suggestion.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz  Well it's not quite showing up as a delegation warning, rather a different error (see above) which is why I was asking @rohsh354 for more info here and if this is actually delegable or not. According to the blog post above, boolean fields should now be delegable.

    Thanks

  • WarrenBelz Profile Picture
    155,058 Most Valuable Professional on at

    @Anonymous ,

    Yes I agree that the docs say so, but I still cannot get them to work properly. I personally do not like blue (or red) lines under any of my code (the workaround suggested says Incompatible Type but I know the underlying value of a Boolean is 1 or 0) as I am then never confident that the returned data will always be correct.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz I agree, I also don't like seeing the yellow triangle anywhere in my app and it's just not clear what the behaviour is here.

    Hope @rohsh354 can provide some more info here.

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 Apps

#1
11manish Profile Picture

11manish 490

#2
WarrenBelz Profile Picture

WarrenBelz 427 Most Valuable Professional

#3
Vish WR Profile Picture

Vish WR 381

Last 30 days Overall leaderboard