Iterating through multiple conditions and connecting to multiple blocks
As mentioned in an earlier post, I prompted GPT4 to build a date range selection function to return weather forecast data for upcoming trips to a destination.
It works by asking for an arrival data and departure date then assigns them a day number from the current date. For example:
Today is 05/21/2024 which is returned as Day0.
If a traveler gives a arrival date of 05/22/2024 and a departure date of 05/24/2024 the function returns the following:
Day0 = 0
Day1 = 1
Day2 = 1
Day3 = 1
Day4 = 0
Day5 = 0
etc…
With the function working, I setup conditions for all the days:
If Day0 is 1
If Day1 is 1
If Day2 is 1
etc… Go to a corresponding block.
My problem is that Voiceflow is not iterating through all the conditions. Voiceflow stops at the first condition that is equal to 1 and will not continue.
In the above example, Voiceflow sees Day1 = 1 and goes to a block for Day1 data then stops.
I need Voiceflow to iterate through every conditions and go to a separate block for each condition that is equal to one.
Using the above example again:
Voiceflow should see Day0 = 0 and go to the next condition.
Then see Day1 = 1 and go to a block for day one, and…
Then see Day2 = 1 and go to a block for day two, and…
Then see Day3 = 1 and go to a block for day three, and…
Then see Day4 = 0 and go to the next condition, and…
Then see Day5 = 0 and go to the next condition, and so on.
How do I iterate through multiple conditions in Voiceflow?
7 Replies
@Tico | Voiceflow Assistant Can Voiceflow run multiple conditions one after the other?
yes
How is the data returned from the LLM?
Can you post a screenshot of your condition and the returned data. Happy to help.
@W. Williams (SFT) I believe I figured it out last night. I realized I could change the default Else path of a block to an And path in it worked. I'll attach before and after shots. If you know of a more efficent way to do this, let me know. Thanks for the offer to help.
This is before

This is after

nice\
Thanks!