I’m filtering a query based on a form, which passes the value of a dropdown to a SC through GET. Regular stuff.
The query works when a single letter is passed, i.e. C or U, but returns empty when the default value of C,U is passed.
Here is the searchrole form element.
And the query uses “IN” as I want both letters to be found and the whole list of people returned. (leaving it empty and passing nothing/Null doesn’t work either
Is an array required? I see lots of MySQL tutorials (ex: https://www.mysqltutorial.org/mysql-basics/mysql-in/) where the syntax is SELECT 1 IN (1,2,3); and there is no mention of arrays. (Pls note I fully realise you are not here to teach SQL, it’s just what I see while researching).
In addition, IN works well on a single value (ex: for the values C or U) which are not set as arrays.
In case an array is required, how do I place an array syntax in the form dropdown values?
The rules for the sql language and for the Wappler action are different. The action adds functionality to make queries easier. The Wappler query action expects an array when using the IN clause. You can use the split formatter on your comma separated string to create an array.
@mebeingken@Teodor@TomD
Understood, made the change works perfectly.
This allows for the form comma-separated values passed to the SC to be split for Wappler internal use, then Wappler passes it along to the mySQL DB as CSVs.
All good, works 100% well.
Thanks!