AnsweredAssumed Answered

Create list with dynamic number of items?

Question asked by wimmmmm on Sep 2, 2017
Latest reply on Sep 27, 2017 by wimmmmm



I'm trying to create a list, based on record, to hold a collection of dates, but I can't figure out how to do this elegantly...


I have:

  • a number of students, that will be attending classes. Classes are scheduled on a particular day & time of the week, every week or every 2 weeks. I call this table "Subscriptions"
  • a table with Holidays, with (at least) 2 fields: HolidayStart and HolidayEnd date. If it's a single date, both fields are equal.
  • a script that wants to populate the table "ActualClasses": these will be actual dates on the particular days of week, but of course not planned on holidays.


I have all the loopings & date calculation working, no problem there.


But I wanted to populate one single list listHolidays, with all the Holiday dates in it, so when trying to create a record in table "ActualClass" for a particular week, i would just need to test the calculated date against the list. If it's in the list, it's a holiday, so I skip & try one week later.


But how do I create such a list from a set of records?

  • if it's a single Holiday, I'll get it via the Summary field into List
  • if it's a range of dates - e.g. Christmas, from 25 Dec 2017 till 7 Jan 2018 - I can't seem to get a function to loop & create a long list, just based on 2 values (start & end). Should I loop in the script itself? Seems dull, but workable.


Am I missing a crucial function here?