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 Gallery in both...
Power Apps
Answered

Search Gallery in both String and numberic fields

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

I am trying to search a gallery in two fields, a string and numeric.  While I can search in the string field, I am unable to add the numeric fields. (I am trying to search on the ID column).

 

My Gallery Itmes is like:

SortByColumns(
 Search(
Filter(.............)

 ),
 TextInput1.Text,
 "Client"
 ),
 "Case_x0020_Id",
 Descending
)

I tried "Client",Text(ID) but I got an error.

 

Thanks in advance

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @Anonymous 

    You can only search text fields, so you might want to change your formula to the following:

    SortByColumns(
     Search(
    AddColumns(Filter(.............), "IDtxt", Text(ID)), TextInput1.Text, "Client",
    "IDtxt" ), "Case_x0020_Id", Descending )

    I am not sure if you meant you were wanting to search "Case_x0020_Id" or ID as you mentioned in the question.

    If it's ID, then this will work for you.  If it is "Case Id", then just substitute "Case_x0020_Id" for ID in the formula.

     

    I hope this helps you.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @RandyHayes  Thank you for that solution. That worked with the gallery but it broke other items like forms with item as: Gallery1.selected and a few Patch formulas.

    The error is: Invalid Formula. Expected a value compatible with 'Datasource'.

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

    @Anonymous 

    Yes, this would be the case.  The reason is, when you change your Items property of a Gallery (or collection) to include new columns (or remove them), any forms will have an issue with the Item that they use from that source - because (in this case) there is now a new column.

    The workaround for that is to Drop the extra column on your Item property of the Form - similiar to recent posting here.

    Basically you will need this formula for your Item property on the Form:

      First(DropColumns(Table(yourGalleryName.Selected), "IDtxt"))

    That will drop the extra column you use and will give the Form the correct signature it is looking for.

     

    Hope that helps out.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you @RandyHayes . That worked like a charm!

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 993

#2
Valantis Profile Picture

Valantis 675

#3
11manish Profile Picture

11manish 545

Last 30 days Overall leaderboard