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

Setting a default value for a choice field

I have a form that is connected to a SharePoint list.  One of the fields is a choice field.  I would like to have a default value for that field.  I can set a default for the field in SharePoint, but it does not carry over to the form.  I don't see a way to set a default in PowerApps.

 

Thanks in advance.

4 REPLIES 4
v-monli-msft
Community Support
Community Support

Hi @JohnRavas,

 

Please try to set below formula on the Default property of the dropdown control:

If(EditForm1.Mode = New, {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
   Id:0,
  Value:"w"}, 
Parent.Default)

"w" is the default value that you want to set.

 

In addition, the related thread you could refer to:

https://powerusers.microsoft.com/t5/Using-PowerApps/Ability-to-set-a-default-value-for-a-Sharepoint-...

 

I just tested and this seems might not work within the EditForm, you might want to use a Dropdown control directly and then use Patch to update the record. 

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

@v-monli-msft, THANK YOU SO MUCH !

I searched for so long on the Internet to find this real answer.

Even the "official" article by Carlos Figueira (https://powerapps.microsoft.com/en-us/blog/default-values-for-complex-sharepoint-types/) written after this thread answer got it wrong.

So thank you, 1000 times thank you.

Beat
Continued Contributor
Continued Contributor

This worked for me in the DefaultSelectedItems properties of a Combo Box. Thank you!

The answer here will work but is more complex than necessary. The linked blog post does work correctly. Make sure you have your syntax right including the V in value uppercase:

If(
    EditForm1.Mode = FormMode.New,
    { Value: "Morning" },
    Parent.Default)

Helpful resources

Announcements
October Events

Mark Your Calendars

So many events that are happening this month - don't miss out!

Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (4,032)