cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jagostinho_CT
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
timl
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.

RandyHayes
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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

@jagostinho_CT 

And what @timl mentioned also...

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

 

 

@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 below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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"
)

 

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

 

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.

@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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (47,019)