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.

View solution in original post

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 😞

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.

View solution in original post

Braden
Level: Powered On

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

That's done it!

 

Thanks for the help and fast response 🙂

myke_deabreu
Level 8

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

No Problem Braden!

 

HAppy Apping!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Kudoed Authors
Users Online
Currently online: 272 members 5,337 guests
Please welcome our newest community members: