cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
stapes
Post Prodigy
Post Prodigy

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

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.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

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.

 

 

 

View solution in original post

4 REPLIES 4
yashag2255
Dual Super User II
Dual Super User II

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!

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.

 

 

 

View solution in original post

yashag2255
Dual Super User II
Dual Super User II

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
Community Support
Community Support

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,098)