Share feedback, ideas and get community help

Updated 2 weeks ago

Option pagination?

Has anyone found a way to handle pagination? I mean within existing typebot features.
I need to display a very long list, the data is dynamic and comes from a http block. Sending the whole list, in whatsapp, in chunks of 3 buttons, becomes quite unmanageable.
My solution was to, alter the endpoint response, chunking the list and appending 2 options to the end, "previous" and "next". Then adding a comparison block to check if one of those values was selected and loop back to the http request, else continue with the flow. For this to work the "multiple choice" option must be checked, which is not ideal, as I need to add another condition to check that only one option is selected.
Has anyone found a better way?
A
F
6 comments
Hey Flavio, in your use case, why do you say it needs the "Multiple choice" option checked for it to work?
Also, I think the way you did it has to be the only way, where you send only a fraction of the response first, then allow the user to see more, which queries the HTTP request again (if the response wasn't received all at once)
Okay I get what you mean now. You want to paginate viewing the response. I initially thought you were talking about paginated API calls, as some APIs don't send a full response and are paginated.
Regarding the list (array) you get from your HTTP Request's response, how do you want to display it to the user?
One item of the array on a new line?
eg.
Plain Text
Item2

Or concatenated next to one another?
eg. Item1 Item2
The multiple choice options is to avoid the button splitting for whatsapp
One item per line
I was looking into forge blocks, maybe custom http-pagination block would be better
Add a reply
Sign up and join the conversation on Discord