Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Creating collection using Filter with two columns - Results returned are wrong?

(0) ShareShare
ReportReport
Posted on by

Hello!

 

I have been building an app and I've just hit an issue with the max collection size of 500 items.  So to reduce the collection size I am creating it with FILTER to allow me to reduce the 100's of items to a few.  The app is using SharePoint as a data source.  When I filter on a single item, be that either text column or Yes/No it returns the correct result.  When I try and filter by two columns I get completely the wrong information. 

 

Employee = Text Column

IsCurrentItem = Yes/No Column

 

Filter.jpg

 

The result should be just one item returned with the IsCurrentItem column set to True.  There are a total of 6 items in the list I am testing against, so the count of 5 in the screenshot shows that it's not including the item with the IsCurrentItem set to True.  If I change the formula and exclude either of the columns it returns the right result.  Is there some special magic with AND when using with FILTER?  This one has me scratching my head!

 

Any help gratefully received.

Rob

 

  • Rob_CTL Profile Picture
    on at
    Re: Creating collection using Filter with two columns - Results returned are wrong?

    @Anonymous we have a winner! 🙂  so it looks like the And was causing the issue, thanks for the help on this, this one is going in the knowledgebase.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at
    Re: Creating collection using Filter with two columns - Results returned are wrong?

    Hi @Rob_CTL,

    Try the below formula and let me know the output;

    ClearCollect(
    	colGetLastMileageNew,
    	Filter(
    		'Mileage Record',
    		Employee.Text = "SharePoint Automation",IsCurrentItem = true
    	)
    )

     

  • Rob_CTL Profile Picture
    on at
    Re: Creating collection using Filter with two columns - Results returned are wrong?

    Quick update: It is something to do with the Yes/No (boolean), if I change this to a Text column the filtering against both column works as expected.  I'd still like to understand if this is a limitation or some other randomness so if anyone has any input?

     

  • Rob_CTL Profile Picture
    on at
    Re: Creating collection using Filter with two columns - Results returned are wrong?

    Hi @Ethan_R 


    Thanks for the formula, the result was a bit random, it brought back a number of other items that had the IsCurrentItem as True, it didn't filter on the Employee name at all.  And even more confusing it also brought back the same records as my screenshot above where the IsCurrentItem is false.  Ok, I am now officially very confused! 🙂

     

    Rob

     

     

  • Ethan_009 Profile Picture
    4,838 Super User 2025 Season 1 on at
    Re: Creating collection using Filter with two columns - Results returned are wrong?

    Hi @Rob_CTL ,

     

    Can you try this and let me know if the formula works as intended.

    ClearCollect(
    	colGetLastMileageNew,
    	Filter(
    		'Mileage Record',
    		( IsBlank(Employee.Text) || Employee.Text = "SharePoint Automation")
    		||
    		( IsBlank(IsCurrentItem) || IsCurrentItem = true)
    	)
    )
    

     

    Hope this helps

     

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard