Check if text contains any items from a list

Hi, I tried searching similar threads, but no one seemed to be able to solve this issue.

If I have a sentence such as “This is just an example phrase for demo purposes”

and I also have a list such as [“list”, “with”, “different”, “words”,“example”]

Is there a way of check if the sentence contains any word from the provided list?

Thanks.

Broader context:
I’m trying to create a habits feature for a Todo app and I want to implement a feature where the user can select which days the habit is on (Sun, Mon, Tues, Wed, Thurs, Fri, Sat).

I currently have a list of days where the habit is recurring [Monday, Wednesday, Friday] and a list of string dates for the next week [“Tuesday, January 17, 2023”, “Wednesday, January 18, 2023”, […], “Sunday, January 22, 2023”].

How can I get a list of all the dates with only the dates for Wednesday, Friday and Monday?

Thank you

You could take the sentence do a split by and then intersect the 2 lists.
Like this
2023-01-16 22.17.37

demo: https://nocode-to-knowcode.bubbleapps.io/version-test/split-sentence?debug_mode=true
editor: Nocode-to-knowcode | Bubble Editor

But I suspect that a better answer is using a plugin like fuzzy search and that probably returns a better list.

1 Like

Hi !

Thanks for the reply, it wasn’t quite what I was looking for, but your intersect with comment made me realize what I was looking for. I will post it as a solution as you were able to answer my initial question.

Thank you !!

For those interested or have a similar problem to me, this is the filter I created based on the list of dates I had.

repeat_weekly is a list of days (option set) where the habit repeats [Monday, Wednesday, Friday]

image

2 Likes

This topic was automatically closed after 70 days. New replies are no longer allowed.