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 / Search based on specif...
Power Apps
Unanswered

Search based on specific characters within a name.

(0) ShareShare
ReportReport
Posted on by 20

Still learning here....

 

I have a name I want to be able to search in a canvas app. An example is:

abcdks123

 

I want to search based on a text entry of the 5th and 6th characters (ks) but ignore the first four characters (abcd). My goal is for users to enter the state (ks) and the gallery only display entries for that state.

 

Is that possible? 

Categories:
  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @DaveHouser ,

    Firstly "ks" would be

    Mid(YourString,5,2)

     so the filter

    With(
     {_State: Mid(YourString,5,2)},
     Filter(
     DataSource,
     YourStateField = _State
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • DaveHouser Profile Picture
    20 on at

    Thank you for the guidance. I'm struggling getting into my flow, though.

     

    Here's what I have now using a Sharepoint List (if that makes a difference):

    SortByColumns(
        If(
            showComplete=true,
            Filter(
                [@'Brightspeed Fiber OFS Validation'],
                StartsWith(
                    olt_clli,
                    TextSearchBox1.Text
                )
            ),
            Filter(
                [@'Brightspeed Fiber OFS Validation'],
                StartsWith(
                    olt_clli,
                    TextSearchBox1.Text
                ) && 'OLT Port Status'.Value=Blank()
            )
        ),
        "Title",
        If(
            SortDescending1,
            SortOrder.Ascending,
            SortOrder.Descending
        )
    )
     
    My goal was to have a second search box to filter down on the state so I think this is what i would need to add someplace:
     
    With(
    {_State: Mid(olt_clli,5,2)},
    Filter(
    [@'Brightspeed Fiber OFS Validation'],
    Statesearch1 = _State

     

     

     

  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @DaveHouser ,

    Try this format - the main reason the With() statement is used is to keep calculations out of the filter, although I am also wondering why you also have a StartsWith filter on the same field as the added query.

    With(
     {_State: Mid(olt_clli,5,2)},
     SortByColumns(
     Filter(
     'Brightspeed Fiber OFS Validation',
     StartsWith(
     olt_clli,
     TextSearchBox1.Text
     ) &&
     (
     !showComplete ||
     'OLT Port Status'.Value = Blank()
     ) &&
     Statesearch1 = _State
     ),
     "Title",
     If(
     SortDescending1,
     SortOrder.Ascending,
     SortOrder.Descending
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • DaveHouser Profile Picture
    20 on at

    When I try to add the With{_State: Mid(olt_clli,5,2)}, I only get olt_clli_datacard1 as a valid entry. It won't accept just olt_clli.

     

    Is that a Sharepoint List error or did I miss something?

     

    My ultimate goal is to only display rows in the gallery based on the search text. Rather than Filtering 2000 row for the 10 i want, trying to get to a point the only items list in the gallery are the rows that match the State or oltclli text.

     

    I appreciate all your assistance. I'm just dense at getting started in this stuff.

  • WarrenBelz Profile Picture
    156,926 Most Valuable Professional on at

    Hi @DaveHouser ,

    I do not know what olt_clli is, but all it has to contain is the required string. If this is in a text control (classic), you can use (with the actual name) instead of olt_clli

    TextControlName.Text

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • DaveHouser Profile Picture
    20 on at

    Sorry, olt_clli is the column name I's searching in the Sharepoint List.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard