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 / Power Apps Choices() F...
Power Apps
Answered

Power Apps Choices() Function for Dropdown Menu - Need an Initial Value of 'Select a type'

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

I am designing a Power App using a SPO list as the data source. I have a dropdown on the screen and a few text controls with a submit button that uses a Patch to write the data to the SP list. My dropdown's Items property uses the code below to populate the dropdown from the choices in my 'Employee-Type' list column. 

This works great however the dropdown is always pre-populated with a value and I want the initial value to be "Select an Employee Type". Any recommendations are greatly appreciated.

Choices('SPO-List-Name'.'Employee-Type')

 

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,554 Most Valuable Professional on at

    The way I've done this in the past is to dump the data source field into a collection after I add the one additional choice that I want at the top of the collection.  Then use that collection in the Choices() formula.

  • Verified answer
    mdevaney Profile Picture
    29,991 Moderator on at

    @Anonymous 

    We have to add "Select an Employee Type" to top of the list of available options since there is no placeholder text property in a dropdown.

     

    Put this code in the OnVisible property of your screen.

     

    ClearCollect(myDropdownOptions, {Value: "Select an Employee Type"});
    Collect(myDropdownOptions, Choices('SPO-List-Name'.'Employee-Type');
    

     

    Then use the collection in the Items property of your dropdown

     

    myDropdownOptions

     

    Finally, write your placeholder text string in the Default value of the dropdown

     

    "Select an Employee Type"

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 

    The easiest way is if you can access your SharePoint list, add _Select an Employee Type as an option and sort the list Ascending in PowerApps.  If not, you can create a collection that includes this option and then collect the rest of the data from SPO. 

    Collect(emptype,Distinct(SPO-List-Name','Employee-Type')),Collect(emptype,{Result:"_Select an Employee Type"})

    You would put this formula in the OnVisible property of your screen.  you can then use Sort(emptype, Result) as the items property of a dropdown control. 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you @mdevaney for providing a detailed solution!

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 483

#2
WarrenBelz Profile Picture

WarrenBelz 399 Most Valuable Professional

#3
11manish Profile Picture

11manish 327

Last 30 days Overall leaderboard