Hi!
I have an issue where I'm trying to configure the calendar screen app (Calendar-screen template in canvas apps - Power Apps | Microsoft Learn)
But I'd like to set a specific calendar.
To do this, I'm removing the drop down functionality, and instead adding the following to OnStart in the App.
I've added a "Office365Outlook" connection, and this seems to work fine.
My problem is, that Office365Outlook.CalendarGetTablesV2().value returns "We Didn't find any data" when in "OnStart", but it works fine when used anywhere else. (See screenprints)
I tested with the usual template for the calendar in the dropdown, where it returns the calendars fine (I have 4). But I can't get it to return any calendars in OnStart.
Set( _userDomain, Right( User().Email, Len( User().Email ) - Find( "@", User().Email ) ) );
Set( _dateSelected, Today() );
Set( _firstDayOfMonth, DateAdd( Today(), 1 - Day( Today() ), TimeUnit.Days ) );
Set( _firstDayInView,
DateAdd( _firstDayOfMonth, -( Weekday( _firstDayOfMonth) - 2 + 1 ), TimeUnit.Days )
);
Set( _lastDayOfMonth, DateAdd( DateAdd( _firstDayOfMonth, 1, TimeUnit.Months ), -1, TimeUnit.Days ) );
Set( _calendarVisible, false );
Set( _myCalendar,
LookUp(Office365Outlook.CalendarGetTablesV2().value, name = "Calendar" )
);
Set( _minDate,
DateAdd( _firstDayOfMonth, -( Weekday(_firstDayOfMonth) - 2 + 1 ), TimeUnit.Days )
);
Set( _maxDate,
DateAdd(
DateAdd( _firstDayOfMonth, -( Weekday(_firstDayOfMonth) - 2 + 1 ), TimeUnit.Days ),
40,
TimeUnit.Days
)
);
ClearCollect( MyCalendarEvents,
Office365Outlook.GetEventsCalendarViewV3(_myCalendar.name,
Text( _minDate, DateTimeFormat.UTC),
Text( _maxDate, DateTimeFormat.UTC)
).value
);
Set( _calendarVisible, true )
In Onstart:

In drop down items:

Data connections:

Best regards