cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Marty3012
Helper II
Helper II

ListBox is empty after every 2nd selection of ComboBox

Hi, I have a ComboBox that connects to a SharePoint List Column (Single line of text). Every time I select an option from the ComboBox the ListBox below will show values from another Column (Lookup) in the same SharePoint List. The first time I make a selection in the ComboBox it returns the correct items in the ListBox, but for every second selection I make the ListBox is empty. Below image shows that the 2nd selection is always empty. I've tried using 'On Change', 'Reset' etc but cant fix the issue. I've not provided detailed code as I was hoping this could be a known issue in one of the settings. Any help appreciated, thanks.

 

ListBoxEmpty.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Since I was populating the ComboBox with a Gallery I worked out what i needed to do was set the 'OnSelect' for the ComboBox to 'Reset(GalleryName)'. This means as soon as I select an option in the ComboBox it clears the current selection in the Gallery and updates the ListBox accordingly.

View solution in original post

4 REPLIES 4
BCBuizer
Super User
Super User

Hi @Marty3012,

 

Can you please share the Items property of the List Box?



Did you like my post? Please give it a thumbs up! Did I resolve your issue? Please click Accept as Solution to close the topic and so other members of the community can find solutions more easily.

Hi. I've worked out why it is acting the way it is. When I delete the current selection and then select another option in the combobox the correct items then appear in the list box;

ListBoxEmpty2.png

 

Consequently what I would like to do is when I select the Combobox the current selection is automatically removed so that the next selection has the correct items in the listbox. I think if this is not possible users would not know to delete the current selection in order for it to work correctly.

 

The items code is below. Basically it pulls in values from the SharePoint look up column and displays them correctly in the listbox.

 

With(
{
sizesString: Concat(
Gallery1_1.Selected.Dependencies,
Value,
" ,"
)
},
With(
{
sizesFormatted: Mid(
sizesString,
1,
Len(sizesString)
)
},
Split(
sizesFormatted,
","
)
)
)

Hi @Marty3012,

Glad that you have resolved your problem.

Mark your reply as an answer to help more users.

Thanks for your cooperation.

Best Regards,
Qi

Since I was populating the ComboBox with a Gallery I worked out what i needed to do was set the 'OnSelect' for the ComboBox to 'Reset(GalleryName)'. This means as soon as I select an option in the ComboBox it clears the current selection in the Gallery and updates the ListBox accordingly.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,960)