Skip to main content

Notifications

Power Apps - Building Power Apps
Answered

Dropdown not showing initial user choice

Posted on by 40
Hello,
I have an issue with a dropdown control (Dropdown1) not defaulting to the initial user choice for a selected item in a gallery. Ideally, the dropdown would default to the initial user choice, but show other list items as options. I've tried setting the Default of the dropdown to ThisItem.'value', but it shows as the first item in the list instead of showing the user choice.  When I change the default of Dropdown1 to the Dropdowninitialchoice, that sort of works, but it defaults to only one of the selected items. So, if, for example, I choose 'P' for one item then 'O' for another item the dropdowns in the gallery show as 'P' for all gallery items.
When I set the Items to collection1, this works, but it only shows the dropdown choices that the user selected, not the full list of options.
Any help is appreciated!
  • Verified answer
    kona134 Profile Picture
    kona134 40 on at
    Dropdown not showing initial user choice
    As it turns out, the reason why ThisItem.Value wasn't working was due to a mismatch between the collected issue code in the collection and the issue code in the gallery dropdown. Changing the collected issue code line from  
    'Issue Code': Left(IssueCodedropdown.Selected.Value, 2)
    To 
    'Issue Code': IssueCodedropdown.Selected.Value
    and matching in both the 'save' icon and  gallery dropdown ended up solving the error.
  • kona134 Profile Picture
    kona134 40 on at
    Dropdown not showing initial user choice
    Hello,
    Here is some more information. Thank you for the help!
    • Your data source type (SharePoint etc) and the list name
    The data source is collection1. The Items field has the list of choices that is filtered based on user selection choice of the specific issue code chosen.
    • The name and and type of field you are reading from and if Choice/Lookup, if it is a single or multiple choice
    It is reading from a different dropdown field (which we can call 'initial issue code dropdown') and the choice is gathered into collection1 on a previous screen.  
    • If this is a Drop-down or Combo Box
    It's a dropdown.
    • Is it is a Classic or Modern control.
    Modern
    • The Items of the control
    Items: 
     
    Filter(
        ["C =Customer Mix w/Stock", "D = Damaged Product", "O =Over(Shipped)", "P =Product Missing", "S = Short (Shipped)", "UP = Unsatisfactory Packaging", "NP =No Paperwork", "NL"],
        !(IsBlank(ThisItem.'Item ID Shipped') || ThisItem.'Issue Code' = "NP") || Value <> "NL" )

     
    • The Default (Dropdown) or DefaultSelectedItems (Combo Box)
    The Default is currently:
    If(
        ThisItem.'Issue Code' = "NP",
        ThisItem.'Issue Code',
        If(
            IsBlank(ThisItem.'Item ID Shipped'),
            ThisItem.'Issue Code',
            "NL"
        )
    )
    
     
    • The Patch code you are using to save the input from the Gallery.
    Patch(
        collection1,
        LookUp(
            collection1,
            Helper = Gallery5.Selected.Helper
        ),
        {
            'Arrival Time': DataCardValue6.Text,
            'Departure Time': DataCardValue7.Text,
            'Qty Ordered': DataCardValue8.Text,
            'Qty Received': DataCardValue10.Text,
            'Qty Shipped': DataCardValue11.Text,
            'Serial Number': DataCardValue12.Text,
            'Service Failure': Switch(
                Checkbox5.Value,
                true,
                "Yes",
                "No"
            ),
            'Customer Failure': Switch(
                Checkbox6.Value,
                true,
                "Yes",
                "No"
            ),
            Comments: DataCardValue15.Text,
      'Issue Code':
        Left(Dropdown1.SelectedText.Value, 1)
    })
     
  • WarrenBelz Profile Picture
    WarrenBelz 143,246 on at
    Dropdown not showing initial user choice
    Please post the following
    • Your data source type (SharePoint etc) and the list name
    • The name and and type of field you are reading from and if Choice/Lookup, if it is a single or multiple choice
    • If this is a Drop-down or Combo Box
    • Is it is a Classic or Modern control
    • The Items of the control
    • The Default (Dropdown) or DefaultSelectedItems (Combo Box)
    • The Patch code you are using to save the input from the Gallery.
  • ronaldwalcott Profile Picture
    ronaldwalcott 855 on at
    Dropdown not showing initial user choice
    You need to provide more information regarding the data source. 
  • Suggested answer
    Rayon Robert Profile Picture
    Rayon Robert 4 on at
    Dropdown not showing initial user choice
    Hi @Kona134
     
    Did you try with the lookup function inside the gallery?
     
    Item Property: 
    Set to the dropdown value that you'd like for the control to show.
     
    Default Property: 
    LookUp(<Your Datasource>, <Primary ID> = ThisItem.<ID>, <Choice Value>)
     
    This ensures that the dropdown defaults to the appropriate value based on the current gallery row's data.
     
    Additionally, if the dropdown’s Items property is linked to a collection or a fixed data source, ensure it contains the full list of options for selection. You can also use the OnChange property to update the selected value back to your data source dynamically, ensuring the dropdown remains in sync with user inputs.
     
    I hope this helps!

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

November 2024 Newsletter…

November 2024 Community Newsletter…

Community Update Oct 28…

Power Platform Community Update…

Tuesday Tip #7 Community Profile Tips…

Welcome to a brand new series, Tuesday Tips…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 143,246

#2
RandyHayes Profile Picture

RandyHayes 76,308

#3
Pstork1 Profile Picture

Pstork1 63,884

Leaderboard