Hello,
I'm trying to have my gallery have a search function using 1 dropdown and 1 text box. My search function currently works for the drop down and the text box but as soon as i try introduce ID to the search function it fails.
This code works perfectly
Search(
If(Dropdown1.Selected.Result = "All", 'CI Funnel', Filter('CI Funnel', 'Department ' = Dropdown1.Selected.Result)),
SearchItem.Text,"Current_x0020_State")
But as soon as i try add ID as seen below
Search(
If(Dropdown1.Selected.Result = "All", 'CI Funnel', Filter('CI Funnel', 'Department ' = Dropdown1.Selected.Result)),
SearchItem.Text,"Current_x0020_State", "ID")
My guess is that value of ID is not seen as text but I'm not sure how to fix this
Any help would be appreciated
Thanks
Solved! Go to Solution.
Hi @Blue281 :
The point is that the search function only work for text column.
You could try this formula:
Filter(
If(
Dropdown1.Selected.Result = "All", 'CI Funnel',
Filter('CI Funnel', 'Department ' = Dropdown1.Selected.Result)
),
SearchItem.Text in 'Current_x0020_State' || SearchItem.Text = "ID"
)
Best Regards,
Bof
Not sure. But can you try this?
If(Dropdown1.Selected.Result = "All", 'CI Funnel', Filter('AddColumn('CI Funnel',"IDText",Text(ID)), 'Department ' = Dropdown1.Selected.Result)),
SearchItem.Text,"Current_x0020_State", "IDText")
Thanks but unfortunately that gives me an error as there isn't a column called "IDText"
That's why we are adding one
If(Dropdown1.Selected.Result = "All", 'CI Funnel', Filter('AddColumn('CI Funnel',"IDText",Text(ID)), 'Department ' = Dropdown1.Selected.Result)),
SearchItem.Text,"Current_x0020_State", "IDText")
Sorry apologies i'm tired and didn't even see the added bit with Add column
however i still get errors as seen below
The given code works perfectly for id column. I have tested it. Your if block is causing problems i think, And honestly i don't see use of that if condition at all. You can write your code without it.
Hi @Blue281 :
The point is that the search function only work for text column.
You could try this formula:
Filter(
If(
Dropdown1.Selected.Result = "All", 'CI Funnel',
Filter('CI Funnel', 'Department ' = Dropdown1.Selected.Result)
),
SearchItem.Text in 'Current_x0020_State' || SearchItem.Text = "ID"
)
Best Regards,
Bof