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 / Modern Controls - Drop...
Power Apps
Suggested Answer

Modern Controls - Dropdown Default Property

(2) ShareShare
ReportReport
Posted on by 51
Evening all, i need some help please. No matter what i do i cannot set the Default Property of the new Modern Control Dropdown control as per the below screenshot. Not matter what syntax i have tried to use (examples below) nothing works and the error of 'Invalid formula. Expected a value compatible with 'Items' persists.
 
ThisItem.OBS_SimplexDuplex

/*LookUp(
    colOuterBoxes,
    OBS_Index = ThisItem.OBS_Index,
    OBS_SimplexDuplex
)*/
/*LookUp(
    colOuterBoxes,
    OBS_Index = ThisItem.OBS_Index
).OBS_SimplexDuplex*/
/*LookUp(
    colOuterBoxes,
    OBS_Index = ThisItem.OBS_Index,
    OBS_SimplexDuplex
) & ""*/
/*Coalesce(
    LookUp(
        colOuterBoxes,
        OBS_Index = ThisItem.OBS_Index,
        OBS_SimplexDuplex
    ),
    ""
)*/

The value is stored in a collection and is initialised as text :     OBS_SimplexDuplex: ""
To be honest i have tried to initialise this differently to no avail.

Am i doing something wrong?

If i use a classic control (marked in blue in the below screenshot) this works just fine and while i here the argument of "just use a modern control then" the design difference between the controls means i cannot get a classic control to mimic the design of a modern control. So why would a modern control not work as per the classic control?

I would greatly appreciate any assistance or pointers to try and resolve this. 

Thank you.

Categories:
I have the same question (0)
  • Pstork1 Profile Picture
    69,397 Most Valuable Professional on at
    What are you using as the formula for the Items property of the dropdown?  The error appears to be related to some mismatch with how that field is defined in the Items property.  Is it a Data Source, a Collection, or something else?

    ----------------------------------------------------------------------------------
    If this Post helped you, please click "Does this answer your question" and give it a like to help others in the community find the answer too!

    Paul Papanek Stork, MVP
    Blog: https://www.dontpapanic.com/blog
     
  • Suggested answer
    Haque Profile Picture
    2,780 on at
    Hi @Sulako,
     
    What is the data type you want to display?  If your dropdown is bound to a complex data source, use a LookUp or filter to return the matching record(s) as a single-item table. For example:
     
    Items = [ { Value: "Red" }, { Value: "Green" }, { Value: "Blue" } ]
    
    DefaultSelectedItems = [ LookUp(Items, Value = "Green") ]
    
     
    Assuming your Dropdown’s Items property is bound to a collection like this:
    ClearCollect(
        colOptions,
        { OBS_SimplexDuplex: "Simplex" },
        { OBS_SimplexDuplex: "Duplex" }
    )
    
     
    And your selected value is stored as text in a variable or context variable, e.g.:
    UpdateContext({ selectedValue: "Simplex" })
    
    Then set the Dropdown’s DefaultSelectedItems property to a single-item table with the matching record:
     
    Filter(colOptions, OBS_SimplexDuplex = selectedValue)
    
    or equivalently:
    [LookUp(colOptions, OBS_SimplexDuplex = selectedValue)]
    
     

    I am sure some clues I tried to give. If these clues help to resolve the issue brought you by here, please don't forget to check the box Does this answer your question? At the same time, I am pretty sure you have liked the response!
  • Suggested answer
    11manish Profile Picture
    2,252 on at
    The issue occurs because modern dropdown controls in Power Apps expect the Default (specifically DefaultSelectedItems) to be a full record that matches the
     
    structure of the Items property, not just a text value. Your formulas return text, which works for classic controls but not for modern ones.
     
    To fix this, you need to return the full record using LookUp and wrap it in a table (e.g., [LookUp(...)]) so it matches the Items schema.
     
    Classic control:
    • Default = "Simplex"
    Modern control:
    • DefaultSelectedItems = [{ OBS_SimplexDuplex: "Simplex", ... }]
  • Sulako Profile Picture
    51 on at
    Hi all, thank you for the feedback so far. The items property is simply  ["Simplex","Duplex"] but no matter what i use in default it still seems to error.

    Regards,


     
  • Sulako Profile Picture
    51 on at
    If it helps here is a simple test for you all to try.

    This errors with - Invalid formula. Expected a value compatible with 'Items'.
     
    Screens:
      Screen1:
        Properties:
          LoadingSpinnerColor: =RGBA(56, 96, 178, 1)
        Children:
          - Button1:
              Control: ModernButton@1.0.0
              Properties:
                Height: =62
                OnSelect: |-
                  =ClearCollect(
                      Test,
                      {
                          OBS_Index: 1,
                          OBS_SimplexDuplexModern:"",
                          OBS_SimplexDuplexClassic: ""
                      }
                  )
                Text: ="Initialise"
                Width: =129
                X: =156
                Y: =88
          - Gallery1:
              Control: Gallery@2.15.0
              Variant: BrowseLayout_Vertical_TwoTextOneImageVariant_ver5.0
              Properties:
                BorderColor: =RGBA(0, 18, 107, 1)
                Fill: =RGBA(180, 214, 250, 1)
                Height: =373
                Items: =Test
                X: =614
                Y: =88
              Children:
                - Subtitle1:
                    Control: Label@2.5.1
                    Properties:
                      BorderColor: =RGBA(0, 0, 0, 1)
                      Font: =Font.'Open Sans'
                      FontWeight: =If(ThisItem.IsSelected, FontWeight.Semibold, FontWeight.Normal)
                      Height: =Self.Size * 1.8
                      OnSelect: =Select(Parent)
                      PaddingBottom: =0
                      PaddingLeft: =0
                      PaddingRight: =0
                      PaddingTop: =0
                      Size: =12
                      Text: =
                      VerticalAlign: =VerticalAlign.Top
                      Width: =
                      X: =
                      Y: =
                - Separator1:
                    Control: Rectangle@2.3.0
                    Properties:
                      BorderColor: =RGBA(0, 18, 107, 1)
                      Fill: =RGBA(255, 255, 255, 1)
                      Height: =8
                      OnSelect: =Select(Parent)
                      Width: =Parent.TemplateWidth
                      Y: =Parent.TemplateHeight - Self.Height
                - Rectangle1:
                    Control: Rectangle@2.3.0
                    Properties:
                      BorderColor: =RGBA(0, 18, 107, 1)
                      Fill: =RGBA(0, 18, 107, 1)
                      Height: =Parent.TemplateHeight - Separator1.Height
                      OnSelect: =Select(Parent)
                      Visible: =ThisItem.IsSelected
                      Width: =4
                - modernDropdown1:
                    Control: ModernDropdown@1.0.0
                    Properties:
                      Default: =Filter(Test,OBS_SimplexDuplexModern = ["Simplex" || "Duplex"])
                      ItemDisplayText: =ThisItem.Value
                      Items: =["Simplex","Duplex"]
                      X: =83
                      Y: =58
                - Dropdown1:
                    Control: Classic/DropDown@2.3.1
                    Properties:
                      BorderColor: =RGBA(0, 18, 107, 1)
                      ChevronBackground: =RGBA(56, 96, 178, 1)
                      ChevronFill: =RGBA(255, 255, 255, 1)
                      ChevronHoverBackground: =ColorFade(RGBA(56, 96, 178, 1), -20%)
                      ChevronHoverFill: =RGBA(255, 255, 255, 1)
                      Default: =ThisItem.OBS_SimplexDuplexClassic
                      Font: =Font.'Open Sans'
                      HoverFill: =RGBA(186, 202, 226, 1)
                      Items: =["Simplex","Duplex"]
                      Items.Value: =Value
                      OnSelect: =Select(Parent)
                      PressedColor: =RGBA(255, 255, 255, 1)
                      PressedFill: =RGBA(0, 18, 107, 1)
                      SelectionColor: =RGBA(255, 255, 255, 1)
                      SelectionFill: =RGBA(56, 96, 178, 1)
                      X: =83
          - Button1_1:
              Control: ModernButton@1.0.0
              Properties:
                Height: =62
                OnSelect: |-
                  =ForAll(
                      Gallery1.AllItems As r,
                      Patch(
                          Test,
                          LookUp(Test, OBS_Index = r.OBS_Index),
                          {
                              OBS_SimplexDuplexModern: modernDropdown1.Selected.Value,
                              OBS_SimplexDuplexClassic: Dropdown1.Selected.Value
                          }
                      )
                  );
                Text: ="Patch"
                Width: =163
                X: =380
                Y: =88
  • Sulako Profile Picture
    51 on at
    Fix:  {Value:ThisItem.OBS_SimplexDuplex}

    I must have tried so many permutations and couldnt have tried this one. 



     

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 April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,041

#2
11manish Profile Picture

11manish 676

#3
Valantis Profile Picture

Valantis 655

Last 30 days Overall leaderboard