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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combobox Default Selec...
Power Apps
Unanswered

Combobox Default Selected Item not showing selected choice when in View/Edit mode

(1) ShareShare
ReportReport
Posted on by 50
I have a comboBox that is not showing the selected choice. I know it has something to do with the defaultselecteditem but I am having trouble finding a solution: 
 
1. ComboBox Opco - there are 4 choices that come from a Sharepoint list (called ;Gas AWC List', this list was created just for choices and cascading option for the Area Work Center Combo Box) column.
Item- Distinct('Gas AWC List',Title)
Default Selected - {Value: ThisItem.'Opco'} THIS WORKS
 
2. ComboBox Area Work Center - depending on the selection of the Opco, the Area Work Centers are filtered 
Item- Distinct(Filter('Gas AWC List',Title=comboState_1.Selected.Value),'AWC')
Default Selected - {Value: ThisItem.'Area Work Center} THIS IS NOT WORKING I have a feeling I need to make a filter or lookup for this to work?
 
In the example below, when I select Item from the Gallery, you can see the combobox for the Area Work Center is blank. 
 
The information entered in the App is stored in the SharePoint List, 'completed procedures' correctly.
This is the choice SharePoint for the two ComboBoxs (Opco and AWC)
 
Any help would be appreciated, thank you in advance!
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,032 Most Valuable Professional on at
    What type of field is 'Area Work Center' ?
  • CU05031456-0 Profile Picture
    50 on at
    Choice
  • Suggested answer
    vipuljain03 Profile Picture
    647 Super User 2025 Season 2 on at
    DefaultSelectedItems expects a table (array).
     
    Modify DefaultSelectedItems property for ComboBox Area Work Center as shown below:
    Instead of: {Value: ThisItem.'Area Work Center'}
     
    Try this: { Value: ThisItem.'Area Work Center'.Value }
    OR ( if ThisItem.'Area Work Center' is already a record, you might need to wrap it inside an array)
    Try this: [{ Value: ThisItem.'Area Work Center'.Value }]
  • Suggested answer
    CU05031456-0 Profile Picture
    50 on at
    Neither one of those worked either -
     
    "This formula uses scope, which is not presently available for evaluation"
     
    [{Value: ThisItem.'Area Work Center'.Value}]
     
    {Value: ThisItem.'Area Work Center'.Value}
     
    [{Value: ThisItem.'Area Work Center'}]
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
     
    Let me start by saying I am super sick and my brain may need some more information.
     
    1. If the below gives you a scope error, then it may think that THAT box is NOT within the Gallery or form. Can you do something silly.
     
    Grab it and see if you can drag it off the form/gallery. If it drags outside of that boundary, then you need to Ctrl-X it then select your Form/gallery, make sure you are within the bounds and paste it in.
     
    2. when you type ThisItem. does it actually bring up the Object 'Area Work Center' ? or are you just typing it in and it doesn't work?
     
    3. Are you sure that based on your items property that you aren't accidentally filtering it out?
     
    4. How does it have a value, if you are dynamically setting it based on another drop downs selection VERSUS actually grabbing it from the Selected Item in the gallery
  • WarrenBelz Profile Picture
    153,032 Most Valuable Professional on at
    I did not get a notification on your initial response.
    To summarise my thoughts, I have to assume that 
    • all of those controls are inside a Form which has the DataSource of 'Completed Procedures'
    • 'Area Work Centre' is a single value Choice field in 'Completed Procedures'
    • Title and AWC are Single Line of Text fields in 'Gas AWC List'
    • The second combo box is a single choice
    So with the Items of the second Combo Box being
    Distinct(
       Filter(
          'Gas AWC List',
          Title = comboState_1.Selected.Value
       ),
       'AWC'
    )
    This will get you a Table with the single field of Value, which is displayed in it as the choices.
    If all of the above is true, then the DefaultSelectedItems should be either
    {Value: ThisItem.'Area Work Center'.Value} 
    or simply
    ThisItem.'Area Work Center'
    If this is not working either one or more of my assumptions is incorrect or there is an issue with the Combo Box. For the second possibility, try with a Classic Combo Box and see if that works.
     
    Please click Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it a Like.
    MVP (Business Applications)    Visit my blog Practical Power Apps    LinkedIn   
  • CU05031456-0 Profile Picture
    50 on at
     
    Your suggestion is exactly how I had it set up and it doesn't work. I just wound up putting a text label over the combo box to show up when in view mode, as nothing else seems to work. At least the form looks complete when I select an entry from the gallery.
     
    Your assumptions were all correct! 
     
    I have a feeling my items are messing up? When I go into edit mode, the choice selected from the submission is showing as an extra choice? Below you can see Nstar twice. If my second combo box (Area work center) is based off the first (opco), would this be where the problem is starting?
     
     
     
     
     
    Text Label pulls over correct data for Area Work Center:
     
     
  • Verified answer
    CU05031456-0 Profile Picture
    50 on at
    I figured it out! The issue was with Combobox One (opco), I just needed to add the .value to the DefaultSelectedItem, as soon as I did that the 2nd combobox value immediately displayed.
     
    1st ComboBox DefaultSelectedItem
     {Value: ThisItem.'Opco'.Value}
    2nd ComboBox DefaultSelectedItem
    {Value: ThisItem.'Area Work Center'.Value}
     
     
  • WarrenBelz Profile Picture
    153,032 Most Valuable Professional on at
    That is why I stipulated that the fields were Single Lines of Text for the code posted to work. I cannot see your data and they are obviously choice fields, so you need .Value after them.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard