Hello,
I have a collection and within that collection I am collecting Outlook Events. I then use that collection to count how many events I have within a given week. However, if I clear the collection/delete all events, my Count functions are still seeming to return "1". I've tried using CountA as well as using CountIf with a condition that filters out blank rows in the column.
Neither of these were giving me the result I'm looking for. If the collection is blank or has 1 event, both of those will just return the same thing; "1".
Is there something I'm missing or is this not a possibility with my process? Thanks for any insight you can provide.
Very appreciative of your response, sorry for all the missing info. Here is the ClearCollect:
ClearCollect(
EventCount,
{
Events: Office365Outlook.GetEventsCalendarViewV3(
LookUp(Office365Outlook.CalendarGetTables().value, DisplayName = "Intake Tracking").Name,
DateAdd(_dateSelected, -Weekday(Sdate,StartOfWeek.MondayZero)),
DateAdd(_dateSelected, 4-Weekday(Sdate,StartOfWeek.MondayZero)))
}
);
This is within the onSelect property of a button. Immediately following this, I define a variable:
Set(Stotal, CountIf(EventCount, Not(IsBlank(Events.value.id))));
I get the feeling it may not be working because collections never return "Blank()"? I have also tried "null", "", & 0 but none provide the result I'm looking for.
This is the collection when it is completely clear of outlook events:
Despite this, upon selecting my button to ensure the collection is ClearCollected, my text label with variable Stotal still reads "1 out of 9". However, when I add a single event, it doesn't update. It continues to just say "1 out of 9". This is how I came to the conclusion that my CountIf is still counting empty rows. I have also tried just CountA but alas, still shows "1 out of 9" with an empty collection.
Once again, truly appreciative of your help. This functionality is huge for my office and I will be eternally grateful if you manage to solve this strange problem. Cheers
How are you clearing your collection exactly?
Trying to reproduce that behavior and it is not occurring
Clear(allassets)
chanegs my countrows(allassets) from 9 to 0 as expected. would you mind sharing the collect code where you collected it, the clear code where you cleared it, and then goto collections area and send a picture of what the collection looks like after the clear?
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
mmbr1606
275
Super User 2025 Season 2