cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AJ13
Level: Powered On

Search Gallery in both String and numberic fields

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

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Search Gallery in both String and numberic fields

@AJ13 

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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Super User
Super User

Re: Search Gallery in both String and numberic fields

@AJ13 

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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Search Gallery in both String and numberic fields

@AJ13 

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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

AJ13
Level: Powered On

Re: Search Gallery in both String and numberic fields

@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'.

Super User
Super User

Re: Search Gallery in both String and numberic fields

@AJ13 

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.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

Highlighted
AJ13
Level: Powered On

Re: Search Gallery in both String and numberic fields

Thank you @RandyHayes . That worked like a charm!

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,547)