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 / ComboBox - Content dep...
Power Apps
Answered

ComboBox - Content dependant on Edit\View DisplayMode value.

(0) ShareShare
ReportReport
Posted on by 88

I have a ComboBox in a gallery with the below parameters...

 

DisplayMode: If(ThisItem.ID=EditRecord,DisplayMode.Edit, DisplayMode.View)

ITEM: ["Desktop PC", "Evoko", "Printer"]

 

Currently, if the ComboBox is set to "Edit", the user can select from one of the predefined items and then the user can patch that item to a SP List.  If the ComboBox is set to "View", i want it to display the "ThisItem.EquipmentType" value found in the SP List.  I tried changing the "Default" to "ThisItem.SIB85_Device_Type", similar to the labels found in the same gallery, but this doesnt work and gives the error...

 

Expected Record Value... It was expecting a record, but the rule produces text values.

 

How can I get the ComboBox to display the SP List ThisItem value is the display mode is "View" and the "Items" values if the display mode is "Edit".

 

I hope that makes sense & thanks in advance.

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @DarkStranger 

    Change your control from a combobox to a dropdown.  A combobox brings only two things to the table - 1. the ability to search and 2. the ability to multi-select.   Based on your information, I am not seeing a need for either.

    A combobox is more complex than a dropdown in that, first of all, the Default property does nothing!  You have to use the DefaultSelectedItems property to set a default...and you must set it to a record that matches the Items property.

    If you change your control to a dropdown, you will go much further.

     

    BUT...if you persist with the combobox, then you need to set the DefaultSelectedItems property to: 

       {Value: ThisItem.SIB85_Device_Type}

    You'll notice this is a record with a Value column...because, your Items property of the Combobox produces a table with a single column called Value...so the record will match.

     

    I hope this is helpful for you.

     

  • DarkStranger Profile Picture
    88 on at

    Thanks for replying.  I have been testing with both the "ComboBox" & "DropDown" and found the below...

     

    ComboBox: I had tried "{value: ThisItem.SIB85_Device_Type}" for "DefaultSelectedItems" and although showing in the SP List, it doesnt show in the "ComboBox", nor shows an error.

    2021-08-26_15-17-39.png

     

    DropDown: If i put "["Desktop PC", "Evoko", "Printer"]" in the "Items", it puts "Desktop" in every gallery row... although by adding "ThisItem.SIB85_Device_Type" to the "Default" parameter it does show the SP List entry.  I could add "["", "Desktop PC", "Evoko"] before desktop to fix the issue, but curious as to why the 1st entry of the items list is populated to every gallery row.

     

    2021-08-26_15-33-54.png

    2021-08-26_15-35-34.png

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @DarkStranger 

    If you are dealing with blank entries in your underlying records, then do the following (with the Dropdown):

    Change the AllowEmptySelection property to true.

    This will allow your dropdown to show blank if the underlying record has a blank in it.  

    If you don't set that property, then the dropdown will automatically select the first item in the Items property records.

  • DarkStranger Profile Picture
    88 on at

    Thanks,

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 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard