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 Apps
Answered

Default Fields

(0) ShareShare
ReportReport
Posted on by 84

Hello

can you help with setting a default.

Below is a screenshot of a form based on a dataverse table. The field type is a choice field; there are two choices - Customer or Supplier. In this example, Lightning Cars is a Supplier. i.e. this data has been added and the supplier option chosen. This is in View Mode. However, I use the same form to Add new data (by clicking the + icon, also in the screenshot). At this point I would like this field to show customer as this will be chosen about 95% of the time. I have tried lots of different ways including adding an If clause when the form in set to FormMode.New, adding a combo box, drop down box but nothing seems to work. 

If I use a combo box, I can choose an option then save but then the chosen option disappears. Whether a Business Partner is customer or supplier does need to be displayed at all times. 

Do I need to use two cards one for choice and one for display?

 

 

Lilywhite63_0-1646732020763.png

 

Categories:
I have the same question (0)
  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Setting the default value of a field to a Dataverse (choice) Option Set value is a little different.   You will need to set it to the name of the Choice Field in Dataverse followed by a dot and then the value you wish to use.

     

    So if your Dataverse choice column is named Supplier Type for example, you would set your default value to 'Supplier Type'.Supplier

  • Lilywhite63 Profile Picture
    84 on at

    Hello

    Unfortunately, this has not worked!

    This is what I have written:

    BPForm is the form that is used for Add, View and Edit

    BPType is the name of the Choice within DataVerse. [For clarity, the name of the table is CCLBPs, the name of the field is Currency]

    Customer is the default choice

     

    When the formula below is added to the DataCardValue, DefaultSelectedItems :
    1) the default shows - i.e. GBP - when the form mode is set to New.

    2) but the field is empty when in either View or Edit mode.

     

    If(BPForm.Mode=FormMode.New,  Choices(BPType.Customer,  Parent.Default))

  • Verified answer
    JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    Try modifying your formula like this:

    If(BPForm.Mode = FormMode.New, Choices(BPType.Customer), Parent.Default)
  • Lilywhite63 Profile Picture
    84 on at

    Thank you - that has worked. I will Accept as Solution

  • Lilywhite63 Profile Picture
    84 on at

    Hello

    Just to confirm: the solution only worked when I added the 'square' brackets around Parent.Default. 

    If(BPForm.Mode=FormMode.New, Choices('BP Type'.Customer), [Parent.Default])

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard