Here is my own resolution
//Days of the week selection, first prepare the collection
If(
!IsEmpty(__Selected_Days),
Clear(__Selected_Days)
);
// set the collection with IDs for each day
If(
LookUp(
__Days_of_week,
_day = 1,
isChoosen
),
Collect(
__Selected_Days,
Filter(
_Availability,
day_of_year >= CC_Date_Pick_1.SelectedDate,
Weekday(day_of_year) = 1
).ID
)
);
If(
LookUp(
__Days_of_week,
_day = 2,
isChoosen
),
Collect(
__Selected_Days,
Filter(
_Availability,
day_of_year >= CC_Date_Pick_1.SelectedDate,
Weekday(day_of_year) = 2
).ID
)
);
If(
LookUp(
__Days_of_week,
_day = 3,
isChoosen
),
Collect(
__Selected_Days,
Filter(
_Availability,
day_of_year >= CC_Date_Pick_1.SelectedDate,
Weekday(day_of_year) = 3
).ID
)
);
If(
LookUp(
__Days_of_week,
_day = 4,
isChoosen
),
Collect(
__Selected_Days,
Filter(
_Availability,
day_of_year >= CC_Date_Pick_1.SelectedDate,
Weekday(day_of_year) = 4
).ID
)
);
If(
LookUp(
__Days_of_week,
_day = 5,
isChoosen
),
Collect(
__Selected_Days,
Filter(
_Availability,
day_of_year >= CC_Date_Pick_1.SelectedDate,
Weekday(day_of_year) = 5
).ID
)
);
If(
LookUp(
__Days_of_week,
_day = 6,
isChoosen
),
Collect(
__Selected_Days,
Filter(
_Availability,
day_of_year >= CC_Date_Pick_1.SelectedDate,
Weekday(day_of_year) = 6
).ID
)
);
If(
LookUp(
__Days_of_week,
_day = 7,
isChoosen
),
Collect(
__Selected_Days,
Filter(
_Availability,
day_of_year >= CC_Date_Pick_1.SelectedDate,
Weekday(day_of_year) = 7
).ID
)
);
//Patch the Collection
ForAll(
RenameColumns(
__Selected_Days,
"ID",
"SID"
),
Patch(
_Availability,
LookUp(
_Availability,
ID = SID
),
{
All_Day_Available: false,
Partially_Available: false,
Unavailable: true
}
)
);
I created a collection and collected all 7 cases where selected and applied patch on them.