I am saving “thing1” to the database, and thing1 has a field that could look like this “wer-123456” or “fff-56789” or millions of other possibilities. I want to check a list of texts in thing2 (that could look like this “wer-,rrr-,abc-” and if the field in thing1 contains any of the text in it from my list of texts in thing2 then I will run some action. How can I make bubble check each entry in the list of texts in thing2 and see if the field in thing1 contains it? Or maybe I am doing this wrong and should approach it differently.
Are you trying to find a thing in the database that already has the text of thing1? Or are you comparing two specific things? What are you trying to do exactly?
The first thing that would come to mind would be this, but you probably already tried that:
If you have a scalar text value (let’s call it text
) and a list of text values (let’s call it textlist
), we can know what values in textlist
are found within text
with the following list expression:
textlist :filtered
(Constraint: text contains This text
)
Screenshot below (ListShifter KW NanoID 2’s Processed List is a list of texts. Textblob is a scalar (single) text value:
That filter expression yields a list of texts that is only the items in textlist
that are found within the single text value, text
. Visualized, it might look something like this:
If we wanted to know how many items in textlist
are found in text
, that’s just the :count
of the filtered list:
textlist :filtered :count
(Constraint: text contains This text
)
If we simply wanted to know whether or not any values in textlist
are found in text
, that’s the boolean expression:
textlist :filtered :count > 0
(Constraint: text contains This text
)
Holy cow! You guys are smarter than me. Thanks for the ideas. For my use case I kept playing around with it and realized that in the text in Thing1 that I am trying to see if any of the text in the list in thing2 is present, it turns out, I just need to know if the characters before and including a dash (which is always in this particular text) are in the list of texts. So I went to google bard, and asked it for a Regex (which is here… ^(.*?)-
) to extract all characters before and including the first dash and then said if this is in my list of text, then run the action.