Skip to main content

Notifications

Community site session details

Community site session details

Session Id : wVk5FkuJztXqoFIE3rqnln
Power Apps - Error Handling
Suggested answer

Dynamic calendar - contents not loading upon start screen

Like (2) ShareShare
ReportReport
Posted on 17 Mar 2025 15:03:24 by 8
Hi all, 
I have a really strange problem that has just started happening today. I've created 2 dynamic calendars in the same way and both were working fine until this morning. 
 
When the user navigates to this particular calendar in Power apps, the data from the Microsoft list (which it's linked to) in the form of buttons, wont show, the calendar is blank. But if the user navigates forward using the arrows to April the data refreshes and appears. Then if you navigate back, the data is there for March. I haven't had this issue with any other calendar I've created. I've checked my other calendars and they are working fine. This calendar also works how it's supposed to, I've tested adding new items and they appear on the calendar and in the linked Microsoft list. I've tried using ChatGPT to ask how to fix this, all solutions aren't working. I'm sort of stuck. I have no idea why it wouldn't be loading upon navigating to the main page all of a sudden. 
 
This is what appears when the user navigates to the link or refreshes the page:
 
 
 
And below is what appears when the user navigates to April then back to March
 
 
I'm honestly stumped as to why this is happening. I've put some properties below for you to help. 
 
 
App - OnStart property: 
 
// Existing logic
Set(CalendarDate, Today());
Set(showConfirmDelete, false);
 
// Initialize the date variables
Set(_dateSelected, Today());
Set(_firstDayOfMonth, DateAdd(Today(), 1 - Day(Today()), TimeUnit.Days));
Set(_firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth, StartOfWeek.Sunday) - 1), TimeUnit.Days));
Set(_lastDayOfMonth, DateAdd(DateAdd(_firstDayOfMonth, 1, TimeUnit.Months), -1, TimeUnit.Days));
 
// Load the calendar data
Refresh('EMEA Key Dates & Events');
ClearCollect(
    CalendarData,
    Filter(
        'EMEA Key Dates & Events',
        ('Start date' <= _lastDayOfMonth && 'End date' >= _firstDayOfMonth)
    )
);
 
// Set calendar visibility
Set(_calendarVisible, true);
 
Screen1 - OneVisible property: 
 
If(
    !IsBlank(Param("Month")),
    // Restore the month from the parameter
    Set(_firstDayOfMonth, DateValue(Param("Month")));
    Set(_firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth, StartOfWeek.Sunday) - 1), TimeUnit.Days));
    Set(_lastDayOfMonth, DateAdd(DateAdd(_firstDayOfMonth, 1, TimeUnit.Months), -1, TimeUnit.Days));
,
    // Default behavior to reset calendar view and date selection to today
    Set(_dateSelected, Today());
    Set(_firstDayOfMonth, DateAdd(Today(), 1 - Day(Today()), TimeUnit.Days));
    Set(_firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth, StartOfWeek.Sunday) - 1), TimeUnit.Days));
    Set(_lastDayOfMonth, DateAdd(DateAdd(_firstDayOfMonth, 1, TimeUnit.Months), -1, TimeUnit.Days));
);
 
// Ensure that calendar data is loaded
Refresh('EMEA Key Dates & Events');
ClearCollect(
    CalendarData,
    Filter(
        'EMEA Key Dates & Events',
        ('Start date' <= _lastDayOfMonth && 'End date' >= _firstDayOfMonth)
    )
);
Set(_calendarVisible, true);
 
GalleryDates - Item property: 
 
Filter(
    'EMEA Key Dates & Events',
    DateValue(DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days)) >= DateValue('Start date') &&
    DateValue(DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days)) <= DateValue('End date') &&
    Month(DateValue(DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days))) = VarCurrentMonth
)
As explained, this only started happening today. What else can I check? I didn't change anything over the weekend and I'm at a bit of a loss as to why this is happening. Another calendar I have built in exactly the same way isn't having the same issues. If anyone could send me some suggestions on how to fix this it would be greatly appreciated. 
 
Thanks! 
  • Steph Profile Picture
    8 on 03 Apr 2025 at 13:45:25
    Dynamic calendar - contents not loading upon start screen
     
    I actually thought I replied to this. I've tried all your suggestions but to no avail unfortunately. Its only started happening since a user requested the calendar ONLY show the items in that month ie. in the screen shot above, it filters out anything from 23rd - 28th Feb when the user selects March. Previously, it just showed all events (so, it would show the 23rd - 28th Feb but in the dark grey squares), but the users found that confusing. When i remove this filter, it loads first time like it should. 
     
    Any suggestions on what else I can try? Or is there a different formula I can use the make sure that when a user navigates to the month they want, it hides any items appearing in the grey squares from the previous or next month? 
     
    Thanks!
     
     
  • Suggested answer
    Michael E. Gernaey Profile Picture
    39,782 Super User 2025 Season 1 on 17 Mar 2025 at 21:42:52
    Dynamic calendar - contents not loading upon start screen
     
    A few things. First a suggestion
     
    1. I would add the Filter to one of these things and NOT to your items directly
    a) Use a Collection, and build it in the OnVisible. However initially name it like this
     
    You can even add in things like ShowColumns to only populate certain columns
    ClearCollect(
    Filter(_MyCollection,
        'EMEA Key Dates & Events',
        DateValue(DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days)) >= DateValue('Start date') &&
        DateValue(DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days)) <= DateValue('End date') &&
        Month(DateValue(DateAdd(_firstDayInView, ThisItem.Value, TimeUnit.Days))) = VarCurrentMonth
    );
     
    Right after do

    ClearCollect(MyCollection, _MyCollection)
     
    Why do this? Because it will stop galleries from Blinking (or tables for that matter)
     
    2. It .. seems as if when you first land, you are falling into this one issue I found long ago. So try this (either skip #1, or do them together)
     
    3. In the OnVisible of the screen do:
    UpdateContext({showGallery: false });
    UpdateContext({showGallery: true });
     
    put this after building the data and then in the Gallery Visible
    showGallery
     
    What this will do is force a reset (even though there is NO reset), it will also help with missing data, and blinking data.
     
    Try those together to get an even better experience.
     
    Cheers,

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,518 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,751 Most Valuable Professional

Leaderboard

Featured topics

Loading started