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

Search function question

Search(Table1,TextSearchBox2.Text, "Employee_x0020_In_x0020_Charge")

 

This is the code that I am using to search, Table1 is a table in an excel file, textsearchbox2 is the user inputted search and Employee_x0020_In_x0020_Charge is one of the column headers in the excel file.

 

I want the user to search through multiple columns at the same time. I looked through the references and it said I could do this:

 

Search(Table1,TextSearchBox2.Text, "Employee_x0020_In_x0020_Charge", [WorkLocation])

 

But doing this gives me an error, saying expected text value.

9 REPLIES 9
charafRef
Level 8

Re: Search function question

You should use Or function in your search formula :

Search(Table1,TextSearchBox2.Text, "Employee_x0020_In_x0020_Charge" or TextSearchBox2.Text, " NameID ").

 

 

 

 

ShanP
Level: Powered On

Re: Search function question

Is there an alternative to or? When I hover over or it says invalid argument type (boolean) expected a text value.

charafRef
Level 8

Re: Search function question

 

see this example on my formula : 
Sort(If(IsBlank(TextSearchBox1.Text); ManuelsLists; Filter( ManuelLists; TextSearchBox1.Text in Text (AnnouncementType) Or TextSearchBox1.Text in Text (Title))); AnnouncementType; If(SortDescending1; SortOrder.Descending; SrtOrder.Ascending))

 

 

ShanP
Level: Powered On

Re: Search function question

Where would I put in my variables? I tried it and it did not work

charafRef
Level 8

Re: Search function question

share your formula , maybe i can resolve it or someone else could help you 

ShanP
Level: Powered On

Re: Search function question

see this example on my formula : 

Sort(If(IsBlank(TextSearchBox1.Text); ManuelsLists; Filter( ManuelLists; TextSearchBox1.Text in Text (AnnouncementType)
Or TextSearchBox1.Text in Text (Title))); AnnouncementType; If(SortDescending1; SortOrder.Descending; SrtOrder.Ascending))

 

 

What is manuelsLists, what is in Text, what is AnnouncementType?

charafRef
Level 8

Re: Search function question

Oups sorry in my head it's was clear lol !

ManuleList = sourcedata

AnnouncementType = column

Title = another column

Text = it's a kind of formula on items you can write it as : 

(AnnouncementType; TextSearchBox1.Text)  

Or :

(TextSearchBox1.Text in Text (AnnouncementType)

 

Hope could helps you ! 

ShanP
Level: Powered On

Re: Search function question

No, it did not help 😞

 

I don't think the or function is working properly for me. And if I copy and paste your formula and insert my variables nothing changes

PK_Hong
Level 8

Re: Search function question

Hi

 

Why not just use SEARCH instead of Filter ? Others remain unchanged.

 

Search(DS, Search.Text, "Column1", "Column2", "  ", " ",....)

Take note that the column to search must be encloded with "...".

 

Hope this helps,

TQ

 

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 325 members 5,533 guests
Please welcome our newest community members: