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

Search Gallery in both String and numberic fields

(0) ShareShare
ReportReport
Posted on by

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,297 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
    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,297 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
    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

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard