cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Luka84
Helper V
Helper V

Combo box "Selected" empty even if value exists in DefaultSelectedItems when loading form

Hi Community,

I have a form connected to SharePoint, and a combo box drawing a long list of items

Basically, when someone selects an item in the Combo Box and saved the form, next time it loads the following happens:

Combo Box loads the previously selected value as i set the "DefaultSelectedItems" value to [Parent.Value]

However "ComboBox.Selected.Result" does not show any value when inserted on a label (RED label in the image below)

I use this basically to generate some information based on the selection. It worked well on the DropDown but now I am totally lost with the Combo Box type

Anyone help? Below screenshot for reference:

 

combobox.png

1 ACCEPTED SOLUTION

Accepted Solutions

So I was able to fix this using a workaround, this is what i did:

Add a label inside the Data Card, let's call that "INTERNAL_LABEL" and use the below formula in the "TEXT" property to reference the default value if the ComboBox selected items was blank (usually the case if loading an existing item with the DefaultSelectedItems property)

TEXT property of INTERNAL_LABEL

 

 

If(IsBlank(combobox.Selected.Result), Parent.Default, combobox.Selected.Result)

 

 

I then create an external label "EXTERNAL_LABEL" and reference the the result of the "INTERNAL_LABEL" to it

TEXT property of the "EXTERNAL_LABEL"

 

 

'INTERNAL_LABEL.Text'

 

 

Works like a charm, just not the best way to do it I guess
Hope this could be helpful for anyone else stuck with this situation

Thanks

Luka

View solution in original post

5 REPLIES 5
mdevaney
Super User
Super User

@Luka84 

What is the Items property of your combo box?

 

Can you put the items code into a collection so we can view the Table?

ClearCollect(tempCollection,
    your_items_code_here
)

 

The collections viewer can be found on the view tab at the top of the screen

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

sk2912
Helper II
Helper II

Hello @mdevaney ,

 

Can you have a look at my issue too.

 

https://powerusers.microsoft.com/t5/General-Power-Automate/Send-email-with-multiple-attachments-from... 

 

Thanks in advance,

Sanket

hI @mdevaney 

Thank you for responding back so promptly.

Just to recap my issue once again, I choose a value in a ComboBox (I can see the value correctly shown when i reference my value in a label), save the form and close it.

When i reload that item, the ComboBox shows my selected value however if I reference the ComboBox.Selected.Result into a label it shows blank.

 

Please see the information below for reference:

ComboBox Items Code (It is already pulling values from an existing collection):

 

SortByColumns( Distinct(Filter(PASSPORTLIST, COUNTRY = COUNTRYDROPDOWN.Selected.Result), EMPLOYEENAME0),"Result", Ascending)

 

 

I've also Put my code into a collection, and it looks like no filters are being applied, instead the entire table is fetched instead of the previously selected item, below image for reference:

TEMPCOLLECTION.png

 

Also, this is how it looks like when I make a change on the ComboBox, label reflects immediately:

combobox selected.png

So I was able to fix this using a workaround, this is what i did:

Add a label inside the Data Card, let's call that "INTERNAL_LABEL" and use the below formula in the "TEXT" property to reference the default value if the ComboBox selected items was blank (usually the case if loading an existing item with the DefaultSelectedItems property)

TEXT property of INTERNAL_LABEL

 

 

If(IsBlank(combobox.Selected.Result), Parent.Default, combobox.Selected.Result)

 

 

I then create an external label "EXTERNAL_LABEL" and reference the the result of the "INTERNAL_LABEL" to it

TEXT property of the "EXTERNAL_LABEL"

 

 

'INTERNAL_LABEL.Text'

 

 

Works like a charm, just not the best way to do it I guess
Hope this could be helpful for anyone else stuck with this situation

Thanks

Luka

meas90
Advocate I
Advocate I

Hi,

 

I think I was able to solve this by using the DataCard.Default property. That way, you won't have to create additional text fields and reference those.

 

If(IsBlank(ComboBox.Selected.Result);ComboBox_DataCard.Default;ComboBox.Selected.Result)

 

Best,

Bastiaan 

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

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