cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Luka84
Advocate III
Advocate III

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 III
Super User III

@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

View solution in original post

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_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,866)