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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to Set Default Cal...
Power Apps
Unanswered

How to Set Default Calendar Name in Dropdown

(0) ShareShare
ReportReport
Posted on by 5,325 Super User 2025 Season 2

I want a Dropdown to default to a shared group calendar from Outlook. I can currently see and access all the calendar options.

I need the Dropdown to 'default' to the desired Outlook calendar with the app/screen opens, causing the Calendar and the event, time and location fields to open, also.

Currently the user to choose from the list in the Dropdown before any of the other controls or fields appear.

The default calendar should be 'Truck Service Schedule Live'. When I manually add the desired calendar in the default and save, publish and open the app, the desired calendar is not the default on open.

I will set the Dropdown DisplayMode to 'Disabled' to prevent users from changing the calendar once this is resolved. 

Dropdown Properties -
Default: "Truck Service Schedule Live"//_myCalendar.DisplayName
Items: Office365Outlook.CalendarGetTables().value
OnChange: Select(dropdownCalendarSelection1)
OnSelect: If(IsBlank(_userDomain),
UpdateContext({_showLoading: true});
Set(_userDomain, Right(User().Email, Len(User().Email) - Find("@", User().Email)));
Set(_dateSelected, Today());
Set(_firstDayOfMonth, DateAdd(Today(), 1 - Day(Today()), Days));
Set(_firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days));
Set(_lastDayOfMonth, DateAdd(DateAdd(_firstDayOfMonth, 1, Months), -1, Days))
);
Set(_calendarVisible, false);
UpdateContext({_showLoading: true});
Set(_myCalendar, Self.Selected);
Set(_minDate, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days));
Set(_maxDate, DateAdd(DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days), 40, Days));
ClearCollect(MyCalendarEvents, Office365Outlook.GetEventsCalendarViewV2(_myCalendar.Name, Text(_minDate, UTC), Text(_maxDate, UTC)).value);
UpdateContext({_showLoading: false});
Set(_calendarVisible, true);

 

Phineas_1-1658168363649.png

 

 

Categories:
I have the same question (0)
  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Phineas ,

     

    It seems there's a lot of variables being set by selecting the dropdown. Are those also set when initialising the app? If not, you might want to add a Select(YourDropdown) command to the OnStart property of your app so the user doesn't have to.

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    No, those variables are not also intiaited at AppStart.

    Most of the formuals you saw are OOTB Microsoft template calendar code.

    I don't understand your instruction regarding 'Select(YourDropdown)' recommendation, please clarify.

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Phineas ,

     

    When clicking on App in the tree view and then selecting the OnStart property, you can triggering functions that are executed when the app is starting:

     

    BCBuizer_0-1658220178111.png

     

    Inserting Select(YourDropdown) (change YourDropdown with the identifier of the dropdown used to select the calendar) will trigger the OnSelect property of the dropdown as if the user were clicking it, initialising all of the variables as defined in there. 

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    Power Apps didn't like you suggestion.

    The error messages are -
    Select of a contnrol that is not on this screen. (though you can see it clearly see it).
    The function 'Select' has some invalid arguments.
    'Select' cannot be used in a proper of the app object.

    Phineas_2-1658236262893.png

     

     

     

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Phineas ,

     

    In that case, can you add it to the OnVisible property of the screen that has the control in it?

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    When I start a new application this is what defaults to the screen.

    The default in the dropdown is as desired with "Truck Service Schedule Live" hard-coded into the Dropdown 'Default' property.

    However, the above does not activate the auto-populate of the Calendar and events fields, controls, or content.

    If I open in 'Edit' and change the Dropdown to 'Edit' and manually select "Truck Service Schedule Live" everything works fine, and I can navigate back and forth between other screen and return to this screen with the Calendar in the same default state.

    The only issue is how to get the the other controls to recognize the default content of the Dropdown as "Truck Service Schedule Live" and display the events and other content associated with that calendar - by Default at OnStart.

    I placed 'Select(CalendarSelectionDropdown)' in the Screen OnVisible.

    Phineas_1-1658244054596.png

     

     

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Phineas,

     

    I tried to use the select with a button and that initiated the calendar instantaneously:

     

    BCBuizer_0-1658245677248.png

     

    What is happening, I think, is that in the PowerApps studio, you are not triggering the OnVisible property. Please try again by adding a random button on any other screen but the CalendarScreen with Navigate(CalendarScreen) as the OnSelect property. I think you'll see this workaround is actually working.

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    I believe you; However, I need it to work at OnStart, without user intervention.

    Is it your conclusion that a button is 'required' to initiate this action?

    That there is no way to set the default of the Dropdown to the desired text automatically at OnStart, and the other calendar controls and fields respond to that action and content?

    It seems to me that these two formulas (in the OnSelect of the Dropdown), are playing a role in the issue.

    Is there no way to update the below so that it ONLY returns the 'Truck Service Schedule Live' calendar title, so that the ONLY title the user sees it ''Truck Service Schedule Live'?

    Set(_myCalendar, Self.Selected);
    ClearCollect(MyCalendarEvents, Office365Outlook.GetEventsCalendarViewV2(_myCalendar.Name, Text(_minDate, UTC), Text(_maxDate, UTC)).value);

  • BCBuizer Profile Picture
    22,505 Super User 2025 Season 2 on at

    Hi @Phineas ,

     

    What I'm saying is that adding the formula to the OnVisible property of the CalendarScreen will achieve your goal of initialization without user intervention. The button was only added to trigger the OnVisible property in PowerApps Studio.

     

    In case you want the dropdown to only display the 'Truck Service Schedule Live' calendar, then what's the point of the dropdown? In that case you might as well configure the whole app to be static.

  • Phineas Profile Picture
    5,325 Super User 2025 Season 2 on at

    Yes, I understand.

    Yesterday, I DID add the formula Select(CalendarSelectionDropdown) to the OnVisible of the main screen (which is the Calendar screen), as you suggested.

    I saved and published. When I came back in what I saw was the images I provided you previously - which was a screen with the Calendar yet to appear, even though the Dropdown had the correct name hard-coded into the Dropdown default (as can be seen in the image), and the formula you recommend in the screen OnVisible.

    I am still missing something (something that I believe is still in the Dropdown OnSelect or OnChange) that is preventing the other controls, fields, and content from activating.

    Phineas_0-1658322354278.png

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard