Hello @R.Zimmer, thisnis the go-to reference for dynamic query in a bpm:
Also take a look at this - if you format your code like this it makes it way easier for people to read: