web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How do I set the defau...
Power Apps
Answered

How do I set the default value of a combobox?

(0) ShareShare
ReportReport
Posted on by 118

Hello,

 

I have a combobox in which the items are populated from a Dataverse table lookup.

 

One of the fields that I'm querying is a Choices field.  On my form, I have an editable combobox in which I'm able to display the choices with the following formula: Choices('Commission Type').Value.  However, I don't know how to set the DefaultSelectedItems property with the choice that is in the Dataverse table.

 

A related question is that if the user changes the selected item in my Canvas App, what is the Patch syntax to update the Dataverse table record?

 

The following code is in the OnStart property of my App:

Lookup:

Set(ProductRecord,LookUp(Products, Product = GUID("<guid>")));

 

The code I tried to use for the DefaultSelectedItems property is 

ProductRecord.'Commission Type'

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @z_mike_90,

     

    Could you try the following code in the DefaultSelectedItems of your combobox:

    LookUp(
     Choices('Commission Type'),
     Value = ProductRecord.'Commission Type'
    )

     

    If this solves your question, would you be so kind as to accept it as a solution.

    Thanks!

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    To answer the related question: If you want to update the record as soon as the user selects another item in the dropdown (or removes the selection), you will need to add some code on the OnChange of the combobox.

     

    Patch(
     Products,
     ProductRecord,
     {'Commission Type': Self.Selected.Value}
    )

     

    If you want to patch the record when clicking a button instead of the OnChange, you will have to swap Self  to the combobox name. Feel free to adjust the code to your needs.

     

    I hope this helps!

  • MZ_980 Profile Picture
    118 on at

    Thanks so much!  Both of your solutions worked like a charm.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 358 Most Valuable Professional

#2
11manish Profile Picture

11manish 214 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 185

Last 30 days Overall leaderboard