Forum Discussion
ValeriaBreve
2 years agoPost Partisan
List.FindText with items from a list?
Hello, I have 2 lists: ListData ListFilter both containing text strings. I would like to find any item in ListData that contains any part of a string from ListFilter. ex. ListData: {"red apple...
- 2 years ago
Another approach, using List.Accumulate to cycle through the ListFilter:
let ListData= {"red apple", "blue apple", "green banana", "red pear"}, ListFilter={"apple","pear"}, filter = List.Accumulate( ListFilter, {}, (s,c)=> s & List.FindText(ListData,c)) in filter
Muhammad_Ahmed
2 years agoHelper I
Hi,
How I will handle this.
let
Source = {"red apple", "blue apple", "green banana", "red pear"},
Custom1 = {"apple","pear"},
Custom2 = List.Select(Source, each List.AnyTrue(List.Transform(Custom1, (substring) => Text.Contains(_, substring))))
in
Custom2