Create/add rows for all possibilities

:wave:

am trying to create all possible appointment slots but cant seem to piece together whole flow with sequence formula and have tried withname, formula map, for each, helper table :sweat_smile:

end goal is after entering start and end dates, then pressing create availability slot button would add to Appointment Slots table of possible combinations (have filled out manually appointment slots table for desired end result).

Added a playground demo doc below:

any insights/teachings would be greatly appreciated :slight_smile:

cheers!
Mel

Hey @Melanie_Teh

Iā€™ve made a copy of your doc and have updated the [Create Availability Slots] buttonā€™s action formula so that it works as youā€™ve described. Iā€™m not sure what the HLP Availability Slots table is for, nor the BTN Create Slots button on the Availability Schedule table. Iā€™m guessing those were both intended to break the problem down into smaller chunks. I didnā€™t end up using either of those - everythingā€™s in that big red button.

The button formula does a lot, so itā€™s quite long. Thereā€™s no real way around that! In cases like this, I find it INVALUABLE to use WithName() to give yourself well-named variables to work with. That helps break the problem down a bit, and makes the overall formula a bit easier to read.

The only other trick here is dealing with rows in Availability Schedule that have blank Start Time, End Time or Availability Types columns. Those would break the logic so thereā€™s an If() block that checks those are valid, and IfBlank() run a hidden action formula called _NoOp(). This formula basically ā€œdoes nothingā€ so itā€™s useful in cases like this where youā€™re looping through valid/invalid rows and donā€™t want your action to break execution half way through.

Hope itā€™s easy enough to follow, but if not, feel free to reach out. Hereā€™s my copy of your doc with the updated [Create Availability Slots] button action:

4 Likes

hey @Jono_Bouwmeester

thank you so much! :grin: :grin: :grin:
and also thank you for the time placed into the explanation and theory behind. much appreciated !

cheers!
Mel

Youā€™re welcome, @Melanie_Teh. It was a fun challenge! :wink:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.