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 / How do I display an ex...
Power Apps
Answered

How do I display an existing value from my database in a ComboBox? Could not find this in the reference documents!

(0) ShareShare
ReportReport
Posted on by 894

I have added a Combo Box to my app. It is correctly displaying the values available for selection from a Flow using a Stored Procedure.

cmbPalletTypes-properties.PNG

 

My problem is getting it to display the existing value from the Database.

I  am getting my data in the screens OnVisible action:

 

    ClearCollect(itemCollection, ViewGoodsInDetailItemByID.Run(SelectedItem.ID)); Set(Selection, First(itemCollection));

 

The data I want to display here is in the variable called Selection - field name PalletType. It matches the Pallet display field. Selection.PalletType seemed like the most obvious choice, but this is flagged as a an error.

 

I am already displaying Selection.Pallet successfully in a TextField but I want to upgrade to a ComboBox.

 

How do I get it to display the current value??

 

I figure this is something to do with the property DefaultSelectedItems.

 

 

Categories:
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @stapes 

     

    Can you share more details about the items property of the combobox control? What is the type of PalletType?

    Selection.Pallet returns a text and it is not a valid input for the Combobox control.

    I am assuming that you have the below configuration:

    Combobox: Items -> itemCollection
    DefaultSelectedItems -> First(itemCollection)

    Here, you can eliminate the creation of Selection variable if you are using it just for this combobox.

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Verified answer
    stapes Profile Picture
    894 on at

    Hi yashag2255

     

    I am sorry. I do not understand your response.

    You say Selection.Pallet returns a text and it is not a valid input for the Combobox control.

    It is meant to be a Text field - so it ought to be a valid input.

    This temporarily worked when I wrapped it in square brackets. No idea why.

    [Selection.Pallet]

    Since I added a second ComboBox it has stopped working altogether, having randomly decided to link my new combobox to this one.

     

     

     

  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hey @stapes 

     

    Combobox expects its items property to be a table. That is why [Selection.Pallet] works and Selection.Pallet doesnot.

    What do have in the configuration of the second combobox control?

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @stapes ,

    Which column do you use as the Display value within the ComboBox? "PalletTypeName" column or "Pallet" column?

     

    Based on the needs that you mentioned, I have made a test on my side, please consider take a try with the following workaround:

    Set the DefaultSelectedItems property of the ComboBox to following:

    {
     PalletTypeName: Selection.PalletType,
     Pallet: Selection.Pallet
    }

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard