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 / Set default property o...
Power Apps
Answered

Set default property of dropdown control but can still select from the dropdown items

(0) ShareShare
ReportReport
Posted on by 249

Hello PowerApps Community, 

 

Is it possible to Set a default value for dropdown with custom items?

 

The default value that I want is to display the department of the employee where the user belongs. 

For example, since I'm from IT department, the default value is IT.

 

So, I used the dropdown control. I used this to get data from office 365: 

(Default property) Office365Users.MyProfile().Department 

 

At the same time, I still want to be able to select custom options like: Sales , HR -, etc. (which is inside the items property of that dropdown)

 

So I used this:

(Items Property): ["HR","Sales","Marketing"]

 

 

But, it won't display the default value when I run my app. 

Is this possible?

 

Thank You and Kind Regards,

Kharina

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,923 on at

    If the (Items Property): ["HR","Sales","Marketing"], in the default, put:
    "Marketing" if you want marketing as default

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • kharina Profile Picture
    249 on at

    Hello Eka, 

     

    Thank you for your reply. But the default value that I want is not on the custom items. 

    Like for me, "IT" is not part of the choices.

     

    I want the default to be taken from Office365 that's why I used: Office365Users.MyProfile().Department   in the default property. 

     

    Is there another way to do it?

     

    Thank You and Kind Regards,

    Kharina

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @kharina ,

    I generally set the default to ThisItem.FieldName (actual field name)

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • eka24 Profile Picture
    20,923 on at

    You mean "IT" is not part of department in Office365Users.MyProfile().Department.

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • kharina Profile Picture
    249 on at

    Hello Eka, 

     

    Yes, IT is a part of the Office365.

    I did it like this:

     

    DD with TI.PNG

     

    I have a TextInput and a Dropdown. I wish to combine to make the value of the TextInput- be the Default of the Dropdown.

     

     

     

     

     

     

     

  • kharina Profile Picture
    249 on at

    Hi Warren, 

     

    Thank you for your reply.

    I tried it but it says that the Name is invalid just when I start to type "ThisItem

     

    It doesn't recognize it in the default property.

     

    Kind Regards,

    Kharina

  • WarrenBelz Profile Picture
    153,117 Most Valuable Professional on at

    Hi @kharina ,

    I will leave you with @eka24 as I posted after his response (I opened the thread before this).

    ThisItem will always work from a field in a form or a gallery. Yours must be outside this.

  • kharina Profile Picture
    249 on at

    Hi Warren, 

     

    I appreciate your time.

    I am not using a gallery. I am doing a customized canvass. 

    So my Patch is: 

    Patch(
    SPList,
    Defaults(SPList),
    {
    Department1: TextInput1.Text,
    Department2: Dropdown1.Selected.Value}


    I wish to put a default value for Dropdown1. The default comes from Office365. But still will give an option to the dropdown items for a selection if the User has 2 positions.

  • Verified answer
    v-siky-msft Profile Picture
    on at

    Hi @kharina ,

    I don't think this is possible since the default value should always be from the items of dropdown.

    As an alternative, make the Items property to be dynamics. Please modify the Items property as below:

     

    If(Office365Users.MyProfile().Department in ["HR","Sales","Marketing"], ["HR","Sales","Marketing"], ["HR","Sales","Marketing",Office365Users.MyProfile().Department])

     

    Default property: 

     

    Office365Users.MyProfile().Department 

     

    Hope this helps.

    Sik

     

  • eka24 Profile Picture
    20,923 on at

    Insert a another Textbox2 (You can later hide it), then set the Default to Dropdown4.Selected.Value

    Then in your textbox1:

    If(IsBlank(Textbox2),"IT",Dropdown4.Selected.Value)

     

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

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 765 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 272

Last 30 days Overall leaderboard