I Love Stackoverflow
I Love Stackoverflow

Reputation: 6868

Power Apps - Use LookUp fields in Search function

I wanted to use the Lookup field in a Search function for my Gallery > Items in Canvas App.

Currently I am using below query:

Search(
   'SRG Scan Quantitiess',
   TextBox_SearchInventory.Text,
   "productcategory",
   "productname",
   "sku",
   "manufacturer",
   "location_textfield"
)

But now, we have replaced the location_textfield with location_lookupfield.

Is there any approach I can use this?

P.S. - I have referred this documentation for syntax of "Search" function but does not seem much helpful for this scenario.

Thanks.

Upvotes: 0

Views: 3509

Answers (2)

user2398510
user2398510

Reputation: 1

An easy way to search on lookup columns is to create a formula column in the source table referring to the lookup column / lookup field, which flattens it into a text value that can be searched. This also works with choices

Upvotes: 0

mmikesy90
mmikesy90

Reputation: 981

Try this: using AddColumns() create a virtual column where the lookup is reduced to text. Then use the virtual column to perform the search.

Search(AddColumns('SRG Scan Quantitiess',"LocationText",location_textfield.Value),TextBox_SearchInventory.Text,"productcategory","productname","sku","manufacturer","LocationText")

Upvotes: 1

Related Questions