"String contains" in Writer Conditions

I’m planning to use Libre Office for templating by filling userfields with external data via Basic or Java.
For my use case conditional text/ paragraphs/ sections are quite important. More precisely I want a section to disappear if a userfield contains a string.

However, all the examples I’ve seen deal with equal/ non-equal strings (e.g. my_variable EQ "somestring")

My question: Is there a way to write something like this in a Writer condition: my_variable LIKE "substring"This condition is supposed to evaluate to TRUE if my_variable contains the substring.

No, the only operators available are listed at Formula - LibreOffice Help. So you need a specific variable for each case.

Move the search to the database, create a query for all fields and variables (with LIKE) for your conditions you need in your document.