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 / How to set the default...
Power Apps
Answered

How to set the default item to be selected in a dropdown using Office365Users Info

(0) ShareShare
ReportReport
Posted on by 1,088

I have a dropdown where I am specifying the items.  ["Seattle","San Diego","Portland"]

 

I am connected to the Office 365 datasource and can populate a label with my office location "Seattle"

 

I want the dropdown to auto populate the users office location but also allow them to choose something different if it is incorrect.

 

For the Default field I have tried

Text(Office365Users.MyProfile().OfficeLocation)
and
Office365Users.MyProfile().OfficeLocation

and

{Value: Text(Office365Users.MyProfile().OfficeLocation)}

and

{Value: Office365Users.MyProfile().OfficeLocation}

 

They all show "Seattle" in the dropdown when I first launch the app, but if I try submitting the form I get error that something is invalid.

 

Anyone know how I can accomplish this?

 

Thanks,

Terry

Categories:
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    What is the error you are getting when submitting?

  • Mattw112b Profile Picture
    1,088 on at

    that something is invalid...

  • SaiKrishnaGudluru Profile Picture
    499 on at

    @Mattw112IG try using "default selected" instead of Default

     

  • Mattw112b Profile Picture
    1,088 on at

    on the dropdown?

    Mattw112IG_0-1596848543431.png

     

    Terry

  • SaiKrishnaGudluru Profile Picture
    499 on at

    @Mattw112IG probably this is because the value in default is not available in the items. So, try this

    [Office365Users.MyProfileV2().officeLocation,"Seattle","San Diego","Portland"]

  • Mattw112b Profile Picture
    1,088 on at

    All offices are in the list, I just simplified it for the post to three instead of writing out 60...

     

    Terry

  • Mattw112b Profile Picture
    1,088 on at

    Hi everyone, been two weeks since I posted originally... There should be a way to do this and I'm sure someone can follow my situation above to give advice?

     

    But again...  I just want to set the default item in a dropdown to the office that shows up in AD for a user... I can get this to work in terms of visually populating the dropdown, but when the form is submitted it says it is invalid entry.

     

    I have tried various things like:

     

    Text(Office365Users.MyProfile().OfficeLocation)
    and
    Office365Users.MyProfile().OfficeLocation

    and

    {Value: Text(Office365Users.MyProfile().OfficeLocation)}

    and

    {Value: Office365Users.MyProfile().OfficeLocation}

     

    None seem to work.

     

    Thanks,

    Terry

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It sounds like your problem is stemming from referencing the value, not setting the default. How are you referencing the dropdown value? Example:

    Dropdown1.SelectedText.Value

     

  • Mattw112b Profile Picture
    1,088 on at

    So you are right, turns out I had the wrong field I was referencing...  ugh.

     

    Thanks,

    Terry

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
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard