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 Apps
Answered

Filter by number

(0) ShareShare
ReportReport
Posted on by

How can I filter by number using the textbox? I have Ticket # field on my SharePoint list and want to use my search box for this. Right now, I can only filter using the dropdown.

 

The Format of my textbox is TextFormat.Number.

 

My current formula is this:

 

Filter (Tracker,(Status.Value = drpStatusMyTickets.Selected.Value || drpStatusMyTickets.Selected.Value = "All") && 'Created By'.Email=User().Email)

 

I tried this formula but didn’t work:

 

Filter (Tracker,(Status.Value = drpStatusMyTickets.Selected.Value || drpStatusMyTickets.Selected.Value = "All") || (txtSearchFilterMyTickets.Text in 'Ticket #') && 'Created By'.Email=User().Email)

 

Been searching for the answers for days now but can't find one. Some mentioned about converting the number to text. Please help.

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

    Hello @biancadevera ,

     

    This is the formula that you need

    Filter (Tracker,(len(txtSearchFilterMyTickets.Text)=0 ||(txtSearchFilterMyTickets.Text = 'Ticket #')))

    Explanation

    We are using the Len() function to not filter anything if the textbox is blank and filter the "tracker" list based on the information inside the text box

     

    Can you try this formula - this might not work as you expected because i'm not sure what exactly your logic is

    Filter (Tracker,(Status.Value = drpStatusMyTickets.Selected.Value || drpStatusMyTickets.Selected.Value = "All") && (len(txtSearchFilterMyTickets.Text)=0 ||(txtSearchFilterMyTickets.Text = 'Ticket #')) && 'Created By'.Email=User().Email)

     

    I made a test case and this is working

     

    Hope this helps ! 🙂

  • biancadevera Profile Picture
    on at

    Hi,

     

    I tried to use the formula you provided but didn't work. Now, I have an error:

     

    Filter (Tracker,(len(txtSearchFilterMyTickets.Text)=0 ||(txtSearchFilterMyTickets.Text = 'Ticket #')))

     

    It says I might need to convert the value to be the same type.

     

    I'm trying to look for the record not identifying the length of the number. Basically, I want to use my textbox to search for a record in my SharePoint list.

  • Anonymous_Hippo Profile Picture
    1,247 Super User 2024 Season 1 on at

    @biancadevera 2021-10-06_13-41-09.gif

     

    Can you tell me what is the value type of Ticket # ? is it a single line field ? we are using the length (LEN) function to not filter anything if the text box is blank

  • biancadevera Profile Picture
    on at

    @Anonymous_Hippo 

    The value type of Ticket # is Number in my SharePoint list. I'm filtering it using gallery. I don't know if that makes sense.

     

     

  • Anonymous_Hippo Profile Picture
    1,247 Super User 2024 Season 1 on at

    @biancadevera 

     

    Can you remove all your formulas and try this and see if it is working

     

    Filter(Tracker,len(txtSearchFilterMyTickets.Text)=0 || txtSearchFilterMyTickets.Text in 'Ticket #')

     

    this should work , if not please share your error message

  • biancadevera Profile Picture
    on at

    @Anonymous_Hippo 

     

    Please check this out

     

    powerapps.png

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @biancadevera 

     

    1. This filter Status either all or selected status
    2. Filter based on ticket number (starts with)
    3. and Current user
    Filter(Tracker,
    (
    (drpStatusMyTickets.Selected.Value = "All" || Status.Value = drpStatusMyTickets.Selected.Value ) || (IsBlank(txtSearchFilterMyTickets.Text) || StartsWith('Ticket #',txtSearchFilterMyTickets.Text))
    )
     && 'Created By'.Email=User().Email
    )

     

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @biancadevera 

     

    Looks like you may have a delegation issue. Use the below code, if you get the warning

    With({_Item: Tracker},
    Filter(_Item,
    (
    (drpStatusMyTickets.Selected.Value = "All" || Status.Value = drpStatusMyTickets.Selected.Value ) && (IsBlank(txtSearchFilterMyTickets.Text) || StartsWith('Ticket #',txtSearchFilterMyTickets.Text))
    )
     && 'Created By'.Email=User().Email
    )
    )

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @biancadevera 

     

    I just noticed, the ticket number is the number, so you may need to convert it to a number like Value(txtcontrol)

    StartsWith('Ticket #',Value(txtSearchFilterMyTickets.Text))

     

     

  • biancadevera Profile Picture
    on at

    Hi @StalinPonnusamy 

     

    I tried the first formula and you're right. I had the delegation issue. But after using the formulas you've provided, I'm still having an error: Invalid argument type (Number). Expecting a Text Value instead.

     

    powerapps1.png

     

    powerapps-error.png

     

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 380 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 340

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 333 Super User 2025 Season 2

Last 30 days Overall leaderboard