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 / How to do search with ...
Power Apps
Unanswered

How to do search with no respect to case.

(0) ShareShare
ReportReport
Posted on by 3,347

I have this condition.  I need to return no matter what the case is.  Helpie?

 

 

Filter(SortByColumns(sData,"PartNumber", Descending), PartNumber in Gallery1.AllItems.'Part Number')

 

Categories:
  • KennyJ Profile Picture
    168 on at

    Hi,

    I would wrap the field im searching and the search text in the Lower function, this way all results are in lower case and doesn’t matter how they were entered.  

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @martinav 

    Since you are using the IN operator, it will ignore case.  The ExactIn function would be used if you want exact case match.

    Please consider changing your Formula to the following:

    SortByColumns(
     Filter(sData, 
     PartNumber in Gallery1.AllItems.'Part Number'
     ), 
     "PartNumber", 
     Descending
    )

    The difference is that you should only be sorting the results of the filter not sorting and then filtering.

    Because - if you have 1000 records and your criteria for the filter will only end up returning 5 results, then with your original formula, you would have sorted 1000 records and then returned 5.  With the above, you are filtering the 1000 down to 5 and then sorting them.  It's better performance.

     

    But, beside the performance part, your original formula should give you what you want - not case related.  So, if it was not, what are you seeing?

     

    I hope this is helpful for you.

     

  • martinav Profile Picture
    3,347 on at

    @RandyHayes ,

     

    Yes, this was taking case into account.  Hence, my post.  I had a different issue that was not returning only a third of the results.  Also, I have the issue that subsequent refres of this command does not return all columns.  Only PartNumber.  This is a problem. 

     

    The internal sort was to eliminate the possibility that there was some odd thing going on with a return one result only scanning once in order... similar to a HLookup command in Excel, where the input data needs to be sorted.

     

    Anyway, I removed the sort.  Issue still remains.  Case does matter, and also the odd issue only returning one column of data when I re-run the command.  Yes, I am sure its the same command.  I copy pasted it from the OnVisible of the paste to a button.  I have to close the app, and reopen to see all columns.  See below:

     

    On first run:

     

    martinav_0-1628940122636.png

     

    I fix the source date for the case of t000001, I re-run the command from a button, then I get this:

    martinav_1-1628940288269.png

    I get my return for T00001, but now, I only get the single column.  I checked the collection in a table of its own, and indeed, only one column is there.  Where did the others go???

     

    ClearCollect(Test_SQL,
     With({sData: VIEW_ALL_PDM_LATEST}, 
     Filter(sData, PartNumber in Gallery1.AllItems.'Part Number')
     )
    )

     

    So, bottom line.  This statement works, but only the first time the app is run, and case matters.

     

  • martinav Profile Picture
    3,347 on at

    Hmm, it seems the single column issue is an anomaly when running in edit mode.  Running app published the columns work fine.  However, the case issue remains.  The statement shows is case dependent.  Regardless.

     

    This still needs a solution.  Using Lower() on both sides of the 'in' statement does not help either.  

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @martinav 

    Turn the "Explicit column selection" feature in your app setting to off if you want all the columns to appear.

     

  • martinav Profile Picture
    3,347 on at

    @RandyHayes ,

     

    It does work in published execution.  Does this setting only affect edit mode?  I'm hesitant to mess with these settings unless its absolutely necessary.  My experience is that there are often unexpected results in other areas when changing these settings.  

     

    Rod

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard