I am having trouble with getting the Data Table Get Filter to work. I want to return all rows where I want to specify for instance Name equals ‘John’ OR ‘Bill’ OR ‘Frank’. What is the right syntax to specify OR in the value as an expression and return all rows that contain my specified values?
Describe the problem/error/question
What is the error message (if any)?
Please share your workflow
(Select the nodes on your canvas and use the keyboard shortcuts CMD+C/CTRL+C and CMD+V/CTRL+V to copy and paste the workflow.)
It depends on how you fill the filter i guess. What’s the node before, how do you start the filter (Telegram, webhook, chat etc.). Do you use any condiation or all conditions. And what is the expression in the condition that you use.
Well hello Michlel, that is exactly the question, what is the expression that has to be used. Tried ‘Mike’ OR "‘John’, did not work. Tried ‘Mike’, did not work. Tried Mike without quotes. That works. Tried Mike|John, did not work. Configured the Data Table node for the above choices for ‘equal’ and ‘contains’. he node before should have no bearing. At this juncture, I’m just trying all combinations without luck by being on the actual Data Table configuration screen and clicking ‘Execute Step’.
So I setup a simple table with a column named Name and colum named Value. I have put a couple of names in it, and some numbers. Then I made this simple workflow.
And then tested it. If I put mark in the chatbots I get back mark.
I don’t think I get your problem at this point (not native english) so some screenshots or something would help.
Yes I want to use OR. I want to retrieve all records where ‘Name’ eq ‘Mike’ OR ‘John’ for instance. Next run it might be ‘Mike’ OR ‘John’ OR ‘Joe’. I cannot hard code an arbitrary number of Any Condition.
Unfortunately data tables are meant for very light use and some basic filtering. If you want to use more complex queries, you’ll need to use a proper database like mysql or postgres (supabase), etc.
In my opinion my use case should fall under very basic filtering. This is a very common use case and a full database might be overkill for the 20 odd rows of data I have. But with Data table still evolving, we have to see what happens down the road. Thanks Wouter.
If this is the answer you are looking for. Then here you go. But I guess you want to get the values from somewhere else. A whebhook, chat or something like that.
Is this what you wanted, or do you need something else.
I missed this thread of yours. It’s a simple DB. So you need some code to get your result. Just get all the rows you have, and use a node ccde to filter on the names you enter. I guess there’s no real other option that I can think of.
No, I do not know before hand how many how many names I will have for each run, sometimes it might be 1, sometimes 10, sometimes 15 so with this approach i will have to add a lot of conditions for one field, not very clean
Thanks for trying. Yes there are other ways and not so clean. At the end of the day, if there a data table, we should be able to do basic filtering like the one I need. Hopefully down the road. Have a great day.
If you only really deal with a few records (up to 1000), then I would suggest you just read all records and then do complex filtering using a Code Node.
Yes thought about doing that. Only reason to open this thread was to find out whether I was missing something in terms of filtering. Many ways to skin the cat, one being not use Data Tables at all. Thanks for the feedback.