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 / Accurate search box
Power Apps
Answered

Accurate search box

(0) ShareShare
ReportReport
Posted on by 32

Hi all, I am building an app where I show a list of orders (a form) with a search bar, and I filter these when matching a condition. Right now It works ok, but not as perfect as I'd like, let me explain.

 

SortByColumns(Filter([@myLIST], StartsWith(Contract, TextSearchBox1.Text)&& Order_Status<>"Shipped"),"Requested_Date", SortOrder.Ascending)

 

As can be appreciated on the previous formula, I use the 'StartsWith' function. Basically that's the reason why it doesn't work as I'd like. Orders are labeled with an alphanumeric string, starting by letter/s. So, it works perfectly only if you type a string in the correct order. This is when the order is called 'OT23484755R' and you start typing 'ot234...'. 

 

So my question would be, can I change my formula to make it work in case the user types, for example, '4755R'?

 

Thanks beforehnd

Categories:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @RC6 ,

     

    Please try this formula:

     

    SortByColumns(Filter([@myLIST],TextSearchBox1.Text in Contract && Order_Status<>"Shipped"),"Requested_Date", SortOrder.Ascending)

     

    Best Regards,

    Bof

  • AndrewR1 Profile Picture
    1,572 Moderator on at

    Hi @RC6 I’m unsure if there is a way to say if the string 'contains xyz' when we are refering to a string data type but you could try the following to have both starts with or endswith functions:

     

    SortByColumns(Filter([@myLIST], StartsWith(Contract, TextSearchBox1.Text)|| EndsWith(Contract, TextSearchBox1.Text)&& Order_Status<>"Shipped"),"Requested_Date", SortOrder.Ascending)

     

    Hope this helps

    Please click Accept as solution if my post helped you solve your issue. ✔️ This will help others find the solution to this problem. It also closes the item. Remember, you can accept more than one post as a solution.

    If the content was useful in other ways, please consider giving it Thumbs Up. 👍

    Thanks
    Andrew

  • RC6 Profile Picture
    32 on at

    Hi @v-bofeng-msft,

    It worked smoothly. Thanks so much for your help and the incredibly fast response.

     

     

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 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard