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

Re: Search with multiple words in multiple columns

Carlos! You are a genuis! This pulls the selected items in like a champ

Such a great overall result, so glad this post was here!

This search functionality is so superior to what I had. My users are going to love it

Thank you sir

 

For anyone looking at the Gallery search string that I provided above, the string now used in my form, which is exactly as Carlos prescribed:

LookUp(CollectionACItems, 'Vendor Item No.' = BrowseGalleryACItems1.Selected.'Vendor Item No.')

ripp
Level: Powered On

Re: Search with multiple words in multiple columns

@CarlosFigueira This solution works for me, the only issue is that it has to be an exact case match in order to show up. If I search for "Eco" and "Tank", I will get results. If I search for "eco" and "tank" I get nothing. Is there a workaround for that?

 

Edit: Sorry simple solution is to just add Lower() to the column and value

MURILOSISNANDO
Level: Powered On

Re: Search with multiple words in multiple columns

Hi Guys,
i really need your help talking about this script provided in this post.

I am trying to use the script provided in this solution but is not working really well, it shows that search only by the first information provided and is not allowing to search by more than one field.

If I search for example only putting one product code works but if I put 2 coded separated by space is not showing anything like image attached.

My code:
Filter(
AddColumns(
ProductsDatas;
"busca";
Sum(
ForAll(
Split(TextInput1.Text; " ");
Find(Result; new_name)
);
Value
)
);
busca = CountRows(Split(TextInput1.Text; " "))
)

Someone can help me finding a solution for that?

MURILOSISNANDO
Level: Powered On

Re: Search with multiple words in multiple columns

Hi @CarlosFigueira ,
i really need your help talking about this script provided in this post.

I am trying to use the script provided in this solution but is not working really well, it shows that search only by the first information provided and is not allowing to search by more than one field.

If I search for example only putting one product code works but if I put 2 coded separated by space is not showing anything like image attached.

My code:
Filter(
AddColumns(
ProductsDatas;
"busca";
Sum(
ForAll(
Split(TextInput1.Text; " ");
Find(Result; new_name)
);
Value
)
);
busca = CountRows(Split(TextInput1.Text; " "))
)

Someone can help me finding a solution for that?

MURILOSISNANDO
Level: Powered On

Re: Search with multiple words in multiple columns

@CarlosFigueira  I am searching in a textbox by 2 productcodes separated by space but is not showing result on my datasource table, it shows only if I filter by only one product code.

vffdd
Level: Powered On

Re: Search with multiple words in multiple columns

@ripp 

Hi am having same case issue.  But can't figure out how to work in  your comment ?

 

"Sorry simple solution is to just add Lower() to the column and value"

 

Can you show me in an example?  Here's my code

 

Filter(AddColumns(PL3,"present",Sum(ForAll(Split(searchbox.Text, " "),If(IsBlank(Find(Result, Level3Description)) And IsBlank(Find(Result, ProcessLevel3)), 0, 1)),Value)),present = CountRows(Split(searchbox.Text, " ")))

 

and that works fine but just can't figure where exactly to put your bit ! Smiley Happy

ripp
Level: Powered On

Re: Search with multiple words in multiple columns

 

I added the Lower() function to my searchbox text and all of the results.

In your case:

Filter(
AddColumns(
PL3,
"present",
Sum(
ForAll(
Split(
Lower(searchbox.Text),
" "
),
If(IsBlank(
Find(
Result,
Lower(Level3Description)
)
) And IsBlank(
Find(
Result,
Lower(ProcessLevel3)
)
),
0,
1
)
),
Value
)
),
present = CountRows(
Split(
searchbox.Text,
" "
)
)
)

This will convert both your entered text and any of your results to all lowercase so the search should work.

 

vffdd
Level: Powered On

Re: Search with multiple words in multiple columns

Perfect @ripp  thanks works perfectly

LearnDevil
Level: Powered On

Re: Search with multiple words in multiple columns

Thanks very much for this thread, it really helped me solve my own issue.  I wanted to filter a gallery based on multiple sections in a listbox.  For so little text, it took a disproportionate amount of time to work out, but your idea of adding a 'present' column was the key.

 

ResCol is my collection containing a column called txtLUthemes (with multiple words in);

LBthemes is my multi choice list box with column called MenuTitle;

 

Filter(AddColumns(ResCol,"present",CountIf(LBthemes.SelectedItems,Find(MenuTitle,txtLUthemes)>0)),present=CountRows(LBthemes.SelectedItems))

 

Once I had this working then I used Left(Concat(LUThemes ,Value & "|"),Len(Concat(LUThemes,Value & "|"))-1)to get the values from the SharePoint LookUp field in my collection.  

 

Finally, I was able to combine the two so that my gallery.items: 

Filter(AddColumns(ResCol,"present",CountIf(LBthemes.SelectedItems,Find(MenuTitle,Left(Concat(LUThemes ,Value & "|"),Len(Concat(LUThemes,Value & "|"))-1))>0)),present=CountRows(LBthemes.SelectedItems))

 

Something to note - ForAll is very particular about its parameters and context so I used CountIf instead.  The process is similar; it rattles down a list of values in a table (Listbox, collection, whatever) and works out if something is true for each one.   If you can't get ForAll to work then consider using it.

cheers,