Hello dear Wappler superstars !
I’m trying to get advantage of the query condition filter as explained above in this thread but I’m not sure how it works exactly…
Here is my query :
What I want is to filter by test_mode and order_current_status in every case.
But also filter by user_id only if the user_id is not empty.
I don’t know what I’m doing wrong as all I can get is an “all or nothing” filter applied.
Meaning… If user_id is passed, I get my query executed as expected.
If not, all my where clause is ignored and I get all rows in table returned.
Thank you very much for your help !
EDIT : I found my answer when trying something counter-intuitive…
Seems like if you use conditions, you have to use them on every branch of the where clause if you don’t want the “all or nothing” behavior described above.
In my case, I added a “dummy” condition that would be always true.
{{true}} should work as well as a condition but I find it more descriptive that way.