cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate I
Advocate I

Search function throws error

I was following the steps in this video while trying to create a SearchBox to look for an input in two fields "ProjectID" and "Project Name" but I am getting an error that I cannot figure out what it means.

 

Also, the Source is a Sharepoint List with only 161 items and both of the fields to be searched are set to be "Single Line of Text".

 

Thank you in advance for your help.

jagostinho_CT_0-1602253299923.png

 

10 REPLIES 10
Highlighted
Super User III
Super User III

Hi @jagostinho_CT 

Looking at your screenshot, you appear to have named your search text box Search.

This name would conflict with the Search function. If you rename the text box to something like txtSearch, that should solve the problem.

Highlighted
Super User III
Super User III

@jagostinho_CT 

Your ProjectID is most likely a numeric column, not a text column.

 

Search only works on text columns.

You can work around this with the following change to your formula:

Search(
    AddColumns(ProjectsInfoDB, "projectIDtxt", Text(ProjectID)), 
    Search.Text, 
    "projectIDtxt", "ProjectName"
)

 

I hope this is helpful for 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.
Check out my PowerApps Videos too!
Highlighted

@jagostinho_CT 

And what @timl mentioned also...

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too!
Highlighted

Thank you for the quick replies.

 

The "ProjectID" field type is Text as all the ProjectIDs contain a mix of numbers and letters such as A123ABC or 999NNN

 

The code below is still producing a similar error.

Search(AddColumns(ProjectsInfoDB,"ProjectIDtxt",Text("ProjectID")),txtSearch_1.Text,"ProjectIDtxt","ProjectName")

jagostinho_CT_0-1602255991712.png

 

And rather than a Yellow sign warning is not displaying a Red sign one. 😞

 

jagostinho_CT_1-1602256085173.pngjagostinho_CT_2-1602256104958.png

 

 

Highlighted

@jagostinho_CT 

So if the columns you are searching are all text, then you need not adjust the formula to add the column as I suggested.

The core reason was as @timl mentioned with the naming.

Your formula should be the following:

Search(ProjectsInfoDB,  
       txtSearch_1.Text,
       "ProjectIDtxt","ProjectName"
)

 

You are putting this formula in the Items property of your Gallery...correct?

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too!
Highlighted

Hi @jagostinho_CT 

Just to confirm, if you don't call AddColumns, do you still receive the same error?

Search(ProjectsInfoDB,
       txtSearch_1.Text,
       "ProjectID"
       "ProjectName"
)

 

Highlighted

Not same, different.

I am thinking because I then need to include "ProjectsInfoDB"?

Search(ProjectsInfoDB,txtSearch_1.Text,"ProjectID","ProjectName")

Which is still throwing an error, though a yellow sign error. The suggested fixes are

1. decrease the number of items. but these are already below 500 items

2. simplify the formula. how to do it? It looks to me that the formula is already very basic

3. Change data source location. I would really like to keep it where it is. Is this really the reason why it is breaking?

 

jagostinho_CT_1-1602257437763.png

 

 

jagostinho_CT_0-1602257350423.png

 

Highlighted

Not sure what you mean by

You are putting this formula in the Items property of your Gallery...correct?

 I am typing in in the Text Input box.

Highlighted

@jagostinho_CT 

What @RandyHayes is asking is - are you entering this formula into the Items property of your gallery control?

 

timl_0-1602257921508.png

 

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,676)