cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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
Highlighted
Resolver III
Resolver III

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
Highlighted
Resolver III
Resolver III

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]

 

 

 

Highlighted
Frequent Visitor

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 😞

Highlighted
Resolver III
Resolver III

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

Highlighted
Frequent Visitor

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

That's done it!

 

Thanks for the help and fast response 🙂

Highlighted
Resolver III
Resolver III

Re: ComboBox DefaultSelectedItem not filtering Gallery on App Load

No Problem Braden!

 

HAppy Apping!

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,631)