...

Set a Default Value for a Dropdown Menu in Power Apps/Dynamics 365 (Model-driven and Canvas Apps)

set-a-default-value-for-a-dropdown-menu-in-power-apps-dynamics-365-model-driven-and-canvas-apps

In most modern apps, it’s common to need to set a default choice in a dropdown menu. But how can you do this in Power Apps/Dynamics 365? The answer is different whether you’re building a Model-driven app or a Canvas app.

In this hands-on tutorial, I’ll show you my simple datasource setup in Dataverse, and then how you can easily set the default choice if you’re using a Model-driven app. For a Canvas app, we’ll need to do a little bit more work, but I’ll show you two options to make it happen.

If you want to learn more about Power Apps Canvas Apps, I’ve partnered with the good folks at Pluralsight to do a 3-hour course. During the course, we’ll build an app from scratch, leveraging data from Dataverse. Check it out! https://pluralsight.pxf.io/LP12Jo

00:00 – Overviewing the problem we’re trying to solve, needing a default choice in our dropdown
00:33 – Reviewing my datasource setup with a table and column in Dataverse
01:03 – Setting the default choice on a Choice/OptionSet datatype in Dataverse (but it might not do what you think!)
01:22 – Setting the default choice for a dropdown in a Model-driven Power App
01:44 – Overviewing the parts of the Canvas App we’re working with
02:13 – Unlocking the Datacard that contains the dropdown control
03:07 – OPTION 1: Hard-coding the value of DefaultSelectedItems on the dropdown control in a Canvas App
03:57 – OPTION 2: Setting the value of DefaultSelectedItems using the Choices function in a Canvas App
05:56 – Real-world tips: Checking that the user actually selected something from the dropdown
08:50 – Recapping how to set the default choice for the dropdown

If you want to set up a free 30-day trial of Power Apps, check out another one of my videos: https://youtu.be/9attR2JnQnU.

Discover more from WIREDGORILLA

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

Continue reading