T
Typebot4mo ago
tgdn.

How to repeat steps multiple times and store the results in an array or in sub-variables?

I'm creating a flow asking about information to a borrower and a co-borrower. The questions are the same for both. The way around this today is duplicating and updating each step two or three times based on the number of borrowers, which is quite tedious since each variable is different and needs to be updated for each step. Any ideas? Thanks! The result would look something like this
{
"borrower.name": "John Doe",
"borrower.email": "borrower@example.com",
"borrower.phone": "1234567890",
"coBorrower.name": "Jane Doe",
"coBorrower.email": "coborrower@example.com",
"coBorrower.phone": "1234567890"
}
{
"borrower.name": "John Doe",
"borrower.email": "borrower@example.com",
"borrower.phone": "1234567890",
"coBorrower.name": "Jane Doe",
"coBorrower.email": "coborrower@example.com",
"coBorrower.phone": "1234567890"
}
2 Replies
Baptiste
Baptiste4mo ago
GitHub
Implement a "Custom" block feature · Issue #249 · baptisteArno/type...
The idea is to be able to aggregate a flow into a reusable block. It would eventually allow us to create cleaner flows.
tgdn.
tgdn.4mo ago
Amazing, thanks! An alternative but more creative solution if we had access to a list of defined variables mid-typebot in the script block: 1. Once the flow is completed, store current defined variables under a namespace variable, for example: name -> borrower.name 2. Jump back to the start of the flow 3. Once you reach the end of the flow, you are back at step 1, use a different namespace, for example coBorrower.name 4. Do this as many times as needed