Tables functionality
# 🤝help
f
Im just getting to grips with tables and thinking of some use cases. is it possible to validate a record exists and then based on that result dynamically send the user a message or take them to a different workflow? for example: bot: please log in with your user id user: 12345 bot: thanks David, you are now logged in. how can i help? (in the background it has taken the user to another workflow named the same as the ID) is this possible? If so, how? @acceptable-kangaroo-64719 @rich-battery-69172
t
I actually just requested this feature. I'm looking to do the same thing. The problem is they don't allow variables in the search query for tables. Adding that functionality would allow it to work. Upvote the feature request if you want it. https://discord.com/channels/1108396290624213082/1142092316216147998/1142092316216147998
f
i dont even understand how to query the table!
t
It took me a bit of banging my head to figure it out. Under your table on the right hand side there is a menu for the query selector. You need to define a query selector, then from the find records you need to select your query selector. It will return your selection into an array.
f
so the user cant query the table?
a
not without writing some code, no.
f
what's the code @acceptable-kangaroo-64719? im sure you got it somewhere ready to copy and paste 😉
a
See https://discord.com/channels/1108396290624213082/1142011151874543747/1142050700646416544 A couple of caviats: * This is not a natural-language search of table data * you have to know exactly what combination of fields you need to select your data * This code needs to be run every time you want to select a different chunk of data
f
Hi Gordy, i think what we need is to validate if a record exists in the table and then to perform an ection based on the result
@acceptable-kangaroo-64719 i am working on something bare with me
r
@here we're working on this feature!
you'll be able to find records based on columns:
table.findOne({ email: "xyz@example.com" })
but also based on dynamic queries:
table.findOne({ query: ["user with email "{email}" that has signed up in the last week", { email: workflow.email } ] })
94 Views