Small Tricks and Tips : PowerApps – setting default value for the choice column

PowerApps form - "DefaultSelectedItems" - for choice field
PowerApps form - "DefaultSelectedItems" - for choice field

Hi All,

Today small tip regarding setting default value to SharePoint column in PowerApps form

Background

  • By default, SharePoint column default value is not getting in PowerApps forms
  • This means for example, even though we set default value for choice column in SharePoint list and we have customized PowerApps form then when we do new form default value does not appear in column or not pre-populate it
  • We have a choice column in our list and in form we are showing in Drop-Down Menu – Display choices using: property
SharePoint list - choice column settings
fig : SharePoint list – choice column settings
  • But after customised form in PowerApps, while creating new item default value is not appearing
New form - default value is not coming for column - Status - after customizing to PowerApp form
fig : New form – default value is not coming for column – Status – after customizing to PowerApp form

Workaround / Trick

  • Select the respective data card value control for our choice field we need to use the following formula for DefaultSelectedItems property
If(mysharepointform.Mode = FormMode.New, { Value: "MY DEFAULT VALUE" }, Parent.Default)

Here,
mysharepointform - name of the sharepoint form

In our case our form name - SharePointForm1

 PowerApps form - "DefaultSelectedItems" - for choice field
fig : PowerApps form – “DefaultSelectedItems – for choice field

In above code if our form is in edit mode then we are setting selected value otherwise we are setting default value – “Approved”

Now when we create “New” item default value will appear as

SharePoint List - New form - Default value for choice column
fig : SharePoint List – New form – Default value for choice column

Thanks !!! HAVE A GREAT DAY AHEAD!!!

Prasham Sabadra

LIFE IS VERY BEAUTIFUL. ENJOY THE WHOLE JOURNEY :) Founder of Microsoft 365 Junction, Speaker, Author, Learner, Developer, Passionate Techie. Certified Professional Workshop Facilitator / Public Speaker. Believe in knowledge sharing. Around 20+ years of total IT experience and 17+ years of experience in SharePoint and Microsoft 365 services Please feel free me to contact for any SharePoint / Microsoft 365 queries. I am also very much interested in behavioral (life changing) sessions like motivational speeches, Success, Goal Setting, About Life, How to live Life etc. My book - Microsoft 365 Power Shell hand book for Administrators and Beginners and 100 Power Shell Interview Questions - https://www.amazon.in/Microsoft-Administrators-Beginners-Interview-Questions/dp/9394901639/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=1679029081&sr=8-11

You may also like...

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Microsoft 365

Subscribe now to keep reading and get access to the full archive.

Continue reading