adjusted sql string

separated the fields, table and search. the search field will be based
on the fields string, or first item in an array.
updated plugin example

flows with the working plugin