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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Correction of Filter code
Power Apps
Answered

Correction of Filter code

(0) ShareShare
ReportReport
Posted on by 2

I was using the below code to filter the gallery and it was working fine:

 

Filter(TblMachHist,TextInput3.Text in SerialNo)

 

As the Sharepoint List is having more than 2500 records, so wanted to improve code for sure filter, so trying to apply the below for more powerful filter but it is producing error, could not understand the reason, 

 

"With(
Filter(
TblMachHist,
Len(TextInput3.Text) = 0 ||
TextInput3.Text in SerialNo
)
)"

 

Please guide correction

 

 

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MIA27

    Filter(TblMachHist, StartsWith(SerialNo, TextInput3.Text)) 

  • MIA27 Profile Picture
    2 on at

    Checked earlier with Startwith, it does not work as *text*, also no correct result on data above 2000 of sharepoint list

    therefore was trying IN method it is working but worried for later, so was trying With().

     

    please guide

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MIA27

    You are wrong. 

  • MIA27 Profile Picture
    2 on at

    you mean I should try again  as below 

     

    Current code 

    Filter(TblMachHist,TextInput3.Text in SerialNo)

     

    Should replace by:

    Filter(TblMachHist, StartsWith(SerialNo, TextInput3.Text)) 

     

    to obtain the filter which will work like *text* for the records around 2300 row

     

    pls. advise, 

     
  • MIA27 Profile Picture
    2 on at

    After posting the reply.

    your advised code worked but not working like *text*

    It has to be exact.

     

    Pls. suggest

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MIA27

    Your formula won't work accurately above 2000 records. Mine will work on thousands of records. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MIA27

    See @WarrenBelz 's blog Practical PowerApps about delegation in SharePoint. 

  • MIA27 Profile Picture
    2 on at

    May be my test is not correct and you people are highly professionals.

    Taking as a granted that if applied the below code, it will can handle the large number of records.

    Filter(TblMachHist, StartsWith(SerialNo, TextInput3.Text))

     

    But my situation is demanding a code for user for *text*, so if he types a portion also, it will fetch the records according to it. Therefore IN was preferred.

     

  • MIA27 Profile Picture
    2 on at

    Few days before Mr. Warren helped me for a solution for another screen and I was just trying to apply some portion of it my the current case. Below is the image of the reply.

    Kindly review and advise me by referring my first post how to solve it

     

    MIA27_0-1679213696787.png

     

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MIA27

    OK but only up to 2000 records max, sorry. 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard