cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Braden
Level: Powered On

ComboBox DefaultSelectedItem not filtering Gallery on App Load

I have created an app which contains a gallery that is connected to a SharePoint list. This list contains a choices column where the user can select multiple items. 

 

I have added a combobox that filters the gallery. If I manually select an item from the combobox, the gallery will filter fine as shown in Capture1.

 

I have set the DefaultSelectedItems property of the combobox to select the first item in the list. When the app loads, the first item is selected as shown in Capture 2. However, the gallery does not display any records. I have to manually remove the selected item and re-add it, this will refresh the gallery and the records will appear.

 

It seems the selected item is a duplicate of the choices that are available, not sure if this is causing the issues and the gallery doesn't recognise the DefaultSelectedItem as a real item, see capture 3.

 

The code I am using to filter the Gallery:

Filter('Consultant Profile Search', First(ComboBox1.SelectedItems) in 'Key Skills' && Last(FirstN(ComboBox1.SelectedItems,2)) in 'Key Skills' && Last(FirstN(ComboBox1.SelectedItems,3)) in 'Key Skills')

 

The code I am using to set the combobox items:

Choices('Attributes List'.'Key Skills')

 

The code I am using to set the combobox defaultselecteditems:

[First(Choices('Attributes List'.'Key Skills'))]

 

How can I have the gallery filter the records from the SharePoint list based on the default selected item when the app first loads?

 

Thanks

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
myke_deabreu
Level 8

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

can you try remove the [ ] from the defaultselected items

 

First(Choices('Attributes List'.'Key Skills'))

 

I just replicated your problem on my side and when I removed the [ ] it fixed the problem for me.

5 REPLIES 5
myke_deabreu
Level 8

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

With you defaultSelectedItems can you try add Value and see if that makes a difference.

 

[First(Choices('Attributes List'.'Key Skills')).Value]

 

 

 

Braden
Level: Powered On

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

Thanks for the suggestion @myke_deabreu 

 

Unfortunately this didn't work, the item is still duplicated and the gallery won't load the records when the app loads Smiley Sad

myke_deabreu
Level 8

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

can you try remove the [ ] from the defaultselected items

 

First(Choices('Attributes List'.'Key Skills'))

 

I just replicated your problem on my side and when I removed the [ ] it fixed the problem for me.

Braden
Level: Powered On

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

That's done it!

 

Thanks for the help and fast response Smiley Happy

myke_deabreu
Level 8

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

No Problem Braden!

 

HAppy Apping!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

Follow PowerApps on Twitter

Stay Up-to-Date by following PowerApps on Twitter

Top Community Contributors for July 2019

Top Community Contributors for July 2019

Let's thank our top community contributors

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

FifthImage

Dynamics 365 and Power Platform April 2019 Release notes

Features releasing from April 2019 through September 2019!

Users Online
Currently online: 47 members 4,181 guests
Please welcome our newest community members: