@Bunly11 ,
As per the PM you sent me - firstly you had an extra bracket in the middle (which was the syntax error - hint for you - always parse your code like the below you would have picked it up). Also, you need to seriously consider throwing away your lookups columns unless you use them directly in SharePoint (please have a read of this blog of mine). However to solve your immediate issue, if you want to search in a Lookup column, you need to use AddColumns()
With(
{TBL:UpdatesTBL},
Search(
Sort(
AddColumns(
Filter(
TBL,
Year(VersionDate) = Year(Today())
),
"Drug",
DrugName.Value
),
VersionDate,
Descending
),
Searchbox1.Text,
"Drug"
)
)
If you are only using one search column, I would also suggest this
With(
{TBL:UpdatesTBL},
Sort(
Filter(
AddColumns(
TBL,
"Drug",
DrugName.Value
),
Year(VersionDate) = Year(Today()) &&
(IsBlank(Searchbox1.Text) || Searchbox1.Text in Drug)
),
VersionDate,
Descending
)
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.