Tom  KuhlT
Voiceflow2y ago
1 reply
Tom Kuhl

Using conditions with multiple blocks

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/14/2024 which is returned as Day0 with a value of 0.

If a traveler gives a arrival date of 05/15/2024 and a departure date of 05/17/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

Then I set up text blocks to test the flow, expecting the above examples of travels days to hit the blocks for Day1, Day2, and Day3, but as you can see by the screenshot, it only hit Day1 then stopped.

Because the API charges by the call and not by the token, I’ve been calling before the function and pulling all the data. The function is then intended to tell the bot what days to display data for.

Anyone have suggestions on setting up a better flow or know how with the current flow that I can hit multiple text blocks when a value of 1 is returned?
Single_Day_Path.png
Was this page helpful?