cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ejules
Frequent Visitor

How to set a pre-populated default value of a Dropdown in EditScreen for a SharePoint Choice field?

Hi Everybody,

 

I'm currently trying to simply set the Default value of a Dropdown in an Edit Form (Form is opened and the Dropdown should have a pre-selection). Even though I did extensive research I couldn't find a solution for a Sharepoint choice field (as I don't know how to find the ID's of those choices and how to reference it?

I have the DropDown with the Selections from Sharepoint ("Inland", "Ausland") and would like to be the Default for a blank form to be "Inland".

  PowerApps1.JPGPowerApps2.JPG

 

Thank you so much for your help.

 

Regards,

ejules

71 REPLIES 71

Hi, Have tried your code however  - error says Choices have invalid arguments

 

LookUp(Choices(Devices.ManufacturerName),Value="Select")

 

Please can you help?

 You can also use this option I posted in this other thread on the combobox/drop-down DefaultSelectedItems:

 

If(IsBlank(YourDataCardValue.Selected.Value), {Value: "Desired Choice Value"}, Parent.Default)

 

Now, if you're just wanting placeholder text to instruct the user then I'd say don't use a default and just set the property InputTextPlaceHolder to: "Choose one" or "Select"

Data Source is set to a SharePoint list. If a default value has been set on the SPFieldName within the list, the LookUp function is not required.

 

Choices([@'SPListName'].'SPFieldName')

It is the same syntax used for the Items property.

It's almost two years after your post, and I still can't get this to work. One would think this would be a simple thing to do. And this platform is supposed to be for non-programmers to use? P-lease! PowerApps sucks. 😠

@SteveCochrane - What formula are you using and is it in the DefaultSelectedItems property?

Frown
Advocate I
Advocate I

Three years after this post, and still no luck. None of the solutions offered worked for me. PA has some cool features, but what it is incapable of, is mind blowing!!!!!!!!

    My project has a button to set the default value which is similar to this case. The use case for this is like when you make purchases online - fill in the shipping address, then click the "Buying address is same as shipping address" button, and the items (including dropdown lists) are copied over to the next section. I got it to work similarly to what you outlined above. The button sets a local variable called "btnPress" to true. Here is the DefaultSelectedItems property:

 

    If(btnPress, {Value: DataCardValue13.Selected.Value}, Parent.Default)

 

     The DataCardValue13 is another dropdown list. The Default property is blank.

 

     I still don't understand why PowerApps doesn't automatically add the default values in SPO lists, though. On Monday, I start teaching non-IT people how to use PowerApps and Power Automate. Yay.

 

Steve in Spain 

 

vwyankee
Helper V
Helper V

@SteveCochrane - It is a wonder why it can't be put in there by default, but the solution is pretty simple once you understand how defaults work.

 

@Frown - What is it that you're trying to use? I just opened one of my test apps that has a choice field and it worked no problem for my new form just setting the DefaultSelectedItems property to:

 

If(frmUsrEdit.Mode=FormMode.New, {Value: "Software"}, Parent.Default)
 
frmUsrEdit is the name of my form and Software is one of the choices in the SharePoint column.
JerryH
Resolver III
Resolver III

I used the following in my Dropdown field - Items: ["Select" , "Area 1" , "Area 2" , "Area 3"]

Select.PNG

@ejules , @AlexPaw I've been reading through this thread and linked threads and trying all these things, then searched some more myself and came across this simple solution. Does exactly what I want it to. When I create a new record on my form, it puts the default value in the drop list.

GraemeNZ_0-1636323912865.png

Insert your own text if required.

Thanks for @NewNW for suggesting this in his post here: https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-set-up-drop-down-default-value-to-a-t... 

 

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,267)