T
Typebot14mo 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": "[email protected]",
"borrower.phone": "1234567890",
"coBorrower.name": "Jane Doe",
"coBorrower.email": "[email protected]",
"coBorrower.phone": "1234567890"
}
{
"borrower.name": "John Doe",
"borrower.email": "[email protected]",
"borrower.phone": "1234567890",
"coBorrower.name": "Jane Doe",
"coBorrower.email": "[email protected]",
"coBorrower.phone": "1234567890"
}
2 Replies
Baptiste
Baptiste14mo 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.OP14mo 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

Did you find this page helpful?