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 / Setting a default valu...
Power Apps
Answered

Setting a default value of a dropdown menu

(0) ShareShare
ReportReport
Posted on by 10
Hello Guys,
 
i've tried quite a long time now and i can't figure it out.
 
I have a form in Powerapps with several datacards. One of them is called 'Projectcode'. Its Items property is set to a column in a sharepoint list and thus displays the options referencing to the entries in those column. That works more then fine.
 
As we want to speed up things and it is rather tedious to select out of all the projects we implemented a barcode scanner. The barcode scanner returns a string (varBarcode) formatted as text that contains a code (e.g. XY123). 
Now the problem: When i scan the my barcode and the variable varBarcode is set, then my dropdown menu should have this project with the same code as default.
So it should look for the correct options that is the same (yes, every code we scan is a option in the dropdown) and select that option as default.
 
Setting the Default property of my dropdown to: LookUp(ProjectOverview, Text(Projectcode) = varSV) is my best approach (atleast it doesnt give an error as many other tries) but it doesnt display anyhting
 
Could you please provide me a solution or point out where my brain is stuck? I am fairly new and that is anything else then logic for me...
 
Thank you in advance and have a great weekend.
 
Best, Oliver
Categories:
I have the same question (0)
  • Verified answer
    Mark Nanneman Profile Picture
    993 Moderator on at
    Is your datasource SharePoint or Dataverse (or something else)?

    To change your default dropdown selected items for your edit form based on a variable try this:

    1. Go to the "Items" property of your Form's drop down.
    2. Copy the items expression from your drop down items property.
    e.g. 

    3.  Go to the "DefaultSelectedItems" property of your drop down
    Paste the items formula, and wrap it in a filter, try this template:
    Filter(Choices(<your-drop-down-choices>, Value = <your-search-variable>)
    e.g.


    If you're working with Dataverse, the Value property of your choices will be coded so that would involve extra steps.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 547

#2
WarrenBelz Profile Picture

WarrenBelz 444 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 322

Last 30 days Overall leaderboard