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 DefaultSelect...
Power Apps
Unanswered

ComboBox DefaultSelectedItems

(0) ShareShare
ReportReport
Posted on by 5,836 Moderator

I need to set the DefaultSelectedItems property of a combobox.   I have tried other suggestions and they don't work.

 

My ComboBox is a list of prefixes.

 

Items Property:

 

 

Ungroup(
 Table(
 {Prefixes: Table({Name: ""})},
 {Prefixes: Filter('Holiday Descriptors', 'Holiday Descriptors (Views)'.Prefixes, Association = DropdownHoliday.Selected.Association)}
 ), "Prefixes")

 

 

Fields: 

 

crc39_name

crc39_itemtype

crc39_association

 

Source:  varRecord   varRecord is set when an item is selected in the Gallery to edit.

varRecord.Prefix

varRecord.PrefixIT

varRecord.PrefixAssoc

 

@RandyHayes 

 

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

    @JR-BejeweledOne 

    What have you tried for the DefaultSelectedItems (DSI), or I should say, what is it you're trying to set it to - varRecord?

    In general, your item(s) that are in the DSI must match the record schema of the Items properly and exactly or there will be no matches.

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

    When an item is selected from the gallery to edit, I want the various controls (dropdowns, date picker etc.) to be set to the values in the gallery record.   

     

    When the user clicks on the Edit icon, it sets varRecord to the value of the selected item.

     

    All of this is underlaid with Dataverse tables.   If I use a legacy dropdown it works fine to set it to a specific varRecord property that contains a matching item.  So the dropdown is set to varRecord.Holiday.

     

    The issue for me is I don't know what schema I need to use for the default items here.    If I go to the Combobox properties pane and click on Fields, the fields are:

     

    crc39_name

    crc39_itemtype

    crc39_association

     

    But in the items property it is:

     

    Ungroup(
     Table(
     {Prefixes: Table({Name: ""})},
     {Prefixes: Filter('Holiday Descriptors', 'Holiday Descriptors (Views)'.Prefixes, Association = DropdownHoliday.Selected.Association)}
     ), "Prefixes")

     

    So do I need to provide the 3 fields listed above and does the source need to match the name exactly, ie: crc39_name, or does the source match what is in the items property, ie: name, association.

     

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JR-BejeweledOne 

    Your DSI property needs to match the schema of 'Holiday Descriptors', 'Holiday Descriptors (Views)'.Prefixes

    That is the record that needs to be matched.  It must have the exact columns and the exact values in it that will match a full record in the Item.

    You cannot match a single value (i.e. the crc39_name, crc39_itemtype, crc39_association) - you must match the entire record.

    So, you need to look at what the schema is for the Filter and then you need to provide a record in the DSI that is the same.

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

    So I think this is where I am struggling. 

     

    I don't think I am formatting the DefaultSelectedItems properly.   [varRecord.Association, varRecord.Prefix]

     

    Here are the view and the fields for the combobox.

     

    prefixview.png

     

     

    fields.png

     

     

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JR-BejeweledOne 

    You have the Items property of the combobox set to Descriptors.

    Does the Descriptors table have records with ONLY Association and Prefix?

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

    No it has Suffix as well.    It's been a few days but I am pretty sure I tried this as well

     

    [varRecord.Prefix, varRecord.Association, varRecord.Suffix] and it didn't work either

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JR-BejeweledOne 

    As mentioned in a prior post - your record provided to the DSI property MUST match EXACTLY the schema of the Items property.  There are a few instances where you can get it to work with a subset of columns, but this is not your instance.  You need to provide the full matching record from the Descriptors table.

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @JR-BejeweledOne, I read this thread quickly so sorry if you already tried/knew this... With the Dataverse connector, if you use the intellisense to reference columns, the label of the table column is used which will map automatically to the correct column. You don't need to know the physical column name. and generally you shouldn't have to specify manually the physical column name (e.g cr82s_name). But if you do, it still should work (last I tried) and it's cases sensitive.

    Cheers

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

    Unfortunately it doesn't work using the column name or the label.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @EricRegnier 

    This really depends on the formula being used.  Some of the formulas in PowerApps do not honor the "friendly name" and require the real name to be specified.  Unfortunately the "intellisense" will not show the real names.

     

    @JR-BejeweledOne Have you tried as I suggested?  Where are you still struggling?

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard