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 / Search on Both Integer...
Power Apps
Unanswered

Search on Both Integer & String at a time on Gallery

(0) ShareShare
ReportReport
Posted on by 80

Hello Fav People,

I have one gallery item has value : below where just Request Id is integer and rest are string.

nejhade_0-1657272240952.png

My concern is. there is only one textInput where user enter value for search  i.e either on Requester_ID(str), Request_status(str),

First_approver_id(str), Second_approver_id(str). With above code I am able achieve this user entering text value , code is able to search all text value.

Now I want in the same text box user enter request_ID= 45 (int) it should sort gallery on request_id too. The way it is doing it for others field.

Is this possible with the same code above?

I don't want to create separate texbox for Request_ID. if created also what to write on Gallery?

 

 

Categories:
I have the same question (0)
  • jorge.daniel Profile Picture
    1,430 Super User 2024 Season 1 on at

    Hi,

     

    Your code seems ok, Is it giving you any trouble? Lets say you have a record ID 45 and you have another record with ID 86 but with approver ID 45, both records will show when you enter 45 in the search box.

  • timl Profile Picture
    36,415 Super User 2025 Season 2 on at

    @nejhade 

    I note the reference to SQL in your formula - I assume the data source of your app is SQL Server?

    The issue with the Search function is that it searches against text fields only. If Requestor_ID is an int column, this explains why you're unable to search against that column.

    The solution to this this to create a SQL View that casts Requestor_ID to the data type varchar (or any other string type). If you then reference the view rather than the table, you'll be able to use your formula to search against Requestor_ID.

     

  • nejhade Profile Picture
    80 on at

    I can achieve this through creating collection too where I can convert request_Id to string but the log table where I need to apply search is too big. I can't affort to create collection every time of that big table. Same with View. 

    suggest me this : If I create one more text box where it will take integer value. i.e REquest Id how will I modify the code of gallery to change on both the textbox. 

    1st textbox: Accept integer

    2nd box : Accept str

    Gallery should apply search from both the boxes.

    how to write that code.

  • timl Profile Picture
    36,415 Super User 2025 Season 2 on at

    @nejhade 

    A SQL view is the best way and most efficient way to do this. Because it is server based, it does not have the same performance impact as a local collection.

    If you want to implement 2 textboxes, you would modify the filter part of your original formula like so:

    Filter('YourTable', SERVICE_TYPE="SQL" && 
     (REQUESTOR_ID = Value(textBoxRequestor.text) ||
     IsBlank(textBoxRequestor.text)
     )
    )

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