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
Ahmedx
2 years agoSuper User
Can you share sample data (ListData and ListFilter) ?
ValeriaBreve
2 years agoPost Partisan
Ahmedx Hello,
ListData: {"red apple", "blue apple", "green banana", "red pear"}
ListFilter:{"apple","pear"}
Desired result: {"red apple", "blue apple", "red pear"}