Share feedback, ideas and get community help

Updated 2 months ago

Can typebot read from results table?

At a glance

The community member asked if it is possible to initialize a value from a field in a record of the results table. Another community member provided an example where they want to store the count of registered users in a variable called num_registrations, but the variable is scoped to individual chat sessions and resets to 0 at the start of each session. They want a way to initialize the num_registrations variable with the existing value from the results table, so that it retains its global value across all sessions.

The community members discussed that it is not possible to keep track of a global variable on a typebot like this. However, they suggested that it could be done using HTTP requests to query the Typebot API, specifically the endpoint to list results with a limit of 1 to get the latest result. They also mentioned that this feature will be easier to implement when a related GitHub issue is resolved.

Useful resources
is it possible to initialize a value from a field in a record of the results table?
B
L
8 comments
I donโ€™t understand the question, more context? ๐Ÿ™‚
@Baptiste
For example, I store the count of registered users in a variable called num_registrations. Since all variables in the flow are scoped to individual chat sessions, we need a way to initialize the num_registrations variable with the existing value from the results table. Simply initializing it with 0 at the start of each session will reset it every time a new chat session begins. Instead, we want this variable to retain its global value across all sessions and increment it as users register during their individual chat sessions.

I believe in he Set Variable Node, we can have a query builder to select data from the result. (We can use an external db of course and use http requests, but I was wondering if it can be done just using the Results).
Unfortunately you can't keep track of a global variable on a typebot like this.
You could maybe do it with HTTP requests that queries the Typebot API!
With param limit set to 1 to only get the latest result
Add a reply
Sign up and join the conversation on Discord