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.

Anonymous
Not applicable

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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,180)