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

Filtering a collection

I am fairly new to powerapps, and I need to filter a collection based on a selected item. The Collection I am using is a clone of a sql table, and I have a working filter for the sql table. 

 

*This works*
Filter(
'[dbo].[equipment2]',
location = Text(ItemSelected.first_name) & " " & Text(ItemSelected.last_name))

 

*This doesn't* (This is my collection)
Filter(
EquipmentMaster,
location = Text(ItemSelected.first_name) & " " & Text(ItemSelected.last_name))

Is there a different syntax when working with collections? Thank you for the help


1 ACCEPTED SOLUTION

Accepted Solutions
nickduxfield
Responsive Resident
Responsive Resident

Out of curiosity,

Can you build the collection with a join of the first and last name into a single text column.

Then try the code again omitting the join of a space (&" "&)

View solution in original post

4 REPLIES 4
nickduxfield
Responsive Resident
Responsive Resident

Out of curiosity,

Can you build the collection with a join of the first and last name into a single text column.

Then try the code again omitting the join of a space (&" "&)

View solution in original post

PaulD1
Super User
Super User

How large (how many rows) is your collection? Could you have hit a delegation limit when cloning your datasource to your collection and the record you want is not present?

As standard the delegation limit is 500 but can be increased to 2000 in App Settings. If the record you want is not in the first 500 rows then maybe it wasn't 'cloned'.

TMelton
Frequent Visitor

Hi, I was in the process of combining the names, but for some reason it decided to work today with the old argument. Not sure why it wanted to play nice today. Thanks for the help, I am still going to join the coloumns however.

nickduxfield
Responsive Resident
Responsive Resident

 

Regarding your syntax

I was thinking of your scenario a little more.

You have 2 drop downs with the rule of both value having to be available before a result can be filtered.

You may like to use

-A calculated column to join the name into 'first last name' then a single combo box to search,

Filter(
'[dbo].[equipment2]',
location = Text(ItemSelected.fullname)

 

-A || or in the syntax so that you can always get a hit on the results. 

Filter(
'[dbo].[equipment2]',
location = Text(ItemSelected.first_name) || Text(ItemSelected.last_name))

 

More:

Because you are creating a collection you can shape on the ay in. Sometimes that can help, sometimes its not needed.

But referring to another suggestion you have here, make sure there is no delegation issue with your collection creation either OnStart or however you trigger it. Otherwise the item will not be availbale to filter.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Top Kudoed Authors
Users online (2,338)