The function Search has some invalid arguments in PowerApps

In this PowerApps Tutorial, We will discuss an error as the function search has some invalid arguments powerapps.

The exact error comes as “The function ‘Search’ has some invalid arguments. Wrong column type. Expects text type“. The error comes while I was using the Power Apps search function.

The function search has some invalid arguments PowerApps

I have a Power apps Blank Vertical Gallery control and I have used the Data Source as “SharePoint” in the PowerApps Canvas app.

The below screenshot represents the Gallery property that has the Layout as “Title, subtitle, and body“. Also, there is a Choice field that I have used under the Body section.

the function search has some invalid arguments powerapps

As per my requirement, I need to search the fields based upon these below columns as:

  • “Title”: It is a Text column that represents in the SharePoint List.
  • “Organization”: It is also a Text column that contains in the SharePoint List.
  • “Department”: It is a Choice column that presents in the SharePoint List.

To search depends upon the above fields, I have written the below formula on the Gallery’s Items property as:

Items = Search('Event Registration Details', SearchBox.Text, "Title", "Organization", "Department")

Where,

  • ‘Event Registration Details’ = SharePoint List Name
  • SearchBox.Text = It is the Text input control Name where the fields to be search that specifies a Text value
  • “Title”, “Organization”, “Department” = SharePoint Column Names

When I was using this above formula, that time I was getting an error as “The function ‘Search’ has some invalid arguments. Wrong column type. Expects text type” like the below screenshot.

The function 'search' has some invalid arguments powerapps

The function ‘Search’ has some invalid arguments

Here, in this above formula, the main issue is, I have used a Choice Column (“Department“) which does not support the Search function. Instead of the Choice column, I have used a Text Column (“EmailAddress“).

Also, I have changed the Body field as “EmailAddress” in the Gallery Properties as shown below. You can refer the below code as:

Items = Search('Event Registration Details', SearchBox.Text, "Title", "Organization", "EmailAddess")

When I implemented this above correct formula, then the error is solved and it was working perfectly for me.

The function 'search' has some invalid arguments in power apps

Read Power Apps Rating Control

Important Points to remember in Power Apps Search Function

Below are some important points that you have to remember while using the Power Apps Search Function, So that it may help you to resolve this above type of error in your apps:

  • If you are using the Data source as Excel Sheet and there is a space in between the column name as like “Employee Name“, then the column name should be “Employee_x0020_Name” in the formula. (Here, each space specifies as “_x0020_“)
  • Similarly, if you are using the Data source like SharePoint, make sure that you have to pass the internal name of the specific column or the column name should be the same as the SharePoint List column name.
  • You do not pass the misspelled column name. Suppose, your column name is “Heading“, then do not pass the column name as “heading” otherwise, you will face this type of above issue.
  • Another important thing is, whatever you are passing the column, that should be a Text column. If not, then you will face this issue.
  • If you are using “;” instead of the normal comma “,” in the Search function formula, then there will be a chance to get the error.

Also, you may like these below Power Apps Tutorials:

In this Power Apps Tutorial, We discussed an error as “The function ‘Search’ has some invalid arguments. Wrong column type. Expects text type“.

  • >