web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Office365Outlook.Calen...
Power Apps
Answered

Office365Outlook.CalendarGetTablesV2().value doesn't work in "OnStart"

(0) ShareShare
ReportReport
Posted on by 6

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: 

Mao9900_0-1686129791357.png


In drop down items: 

Mao9900_1-1686129862062.png

 

Data connections: 

Mao9900_2-1686129892112.png
Best regards



Categories:
I have the same question (0)
  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Mao9900 ,

     

    The reason is you have placed the formula in a property requires to be act (OnStart). If placing OnSelect of a button, result is the same.

    vjefferni_0-1686213318898.png

     

    If you want to check, you can select the variable name in Set function after running OnStart of App.

     

    Best regards,

  • Mao9900 Profile Picture
    6 on at

    Thanks a lot! I'm going to accept as solution, although it was just part of the problem. 
    I actually did try to run on start previously, but you made me sure it was the right way around, and I started looking for other answers. 

    So the real issue was that, when I was using V3 of "Office365Outlook.GetEventsCalendarViewV3(_myCalendar.name
    It just returns the name, and not ID for the rest of the code. Since .Name before was ID, and .name now is the displayname. Thanks microsoft. 

    So I had to change the rest of the code to using .id instead of .name 

    Pretty annoying actually. 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 356 Most Valuable Professional

#2
11manish Profile Picture

11manish 225 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 211

Last 30 days Overall leaderboard