If a comma-separated list of numbers is entered as a search parameter using the ‘IN’ operator in query builder, Wappler surrounds the list in single quotes. As a result the query will fail (it will return only the first item in the list). I think this is a bug, unless I’m using the option incorrectly.
In this example (what I’m working on at the moment), a list of IDs is stored in a cookie as items are selected from a list, and the contents of the cookie is then used in the query. This is working as it should, up to a point.
I’ve included a static list of numbers in the query, as well as the list from the cookie, to check that the format etc. is correct:
The relevant part of the query generated is:
stock WHERE (
stock_id IN (‘4146,3011’) OR
stock_id IN (‘4146,5137,4380’))
… so everything is working as it should, except Wappler is adding single quotes around the list of numbers, so the query fails. Without the quotes, the query returns the correct results.
I raised this issue about a year ago (obviously not in relation to Wappler, but to the DW extensions), but I don’t think the matter was ever resolved. I would have thought it would be quite easy to fix and it would be a useful feature to have working.