cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MikeAnderson
Level 8

Filter on Collection not working correctly

I have a simple collection that is populated from a database view.

ClearCollect(PendingEquipmentCollection, '[dbo].[vwPendingEquipment]')

I have two gallerys.  One gallery the user selects and ID from, which then filters the above collection.  My issue is, the filter code is not working against the collection, but it works against the view.

 

This works:

Filter('[dbo].[vwPendingEquipment]', RequestID = TreeGallery_DetailsScreen.Selected.Entity)

This does not:

Filter(PendingEquipmentCollection, RequestID = TreeGallery_DetailsScreen.Selected.Entity)

What's even more perplexing, if I hard code the value of the entity into the collection filter, it still doesn't work, for example:

Filter(PendingEquipmentCollection, RequestID = "123456")

But if I change the column I'm filtering on, it works, for example:

Filter(PendingEquipmentCollection, Job = " 1202.")

Any thoughts on why this is not working when it works just fine directly against the view?

Filter(PendingEquipmentCollection, RequestID = TreeGallery_DetailsScreen.Selected.Entity)

For those who are more visual, here is a screenshot to validate the working vs non-working against the same id:

 

Working:

Working.png

 

Not working:

Notworking.png

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft v-siky-msft
Microsoft

Re: Filter on Collection not working correctly

Hi @MikeAnderson ,

 

Is there any error information with the formulas? What is data type of ‘Request ID’ column? Is there any value in Request ID Column? Is there any other formulas applied to change the value of collection.

Please check if the RequestID column has been populated with proper value in your Collection?

I have made a test,  and don’t have issue you mentioned. The gallery can be filtered well against the collection.

RequestID  and  TreeGallery_DetailsScreen.Selected.Entity should have same data type. So could you use two Tables to show RequestID column of collection and data source to check if there is any difference between values? Or you can put the below formula to Text property of Label to check if both of them are same.

 

First('[dbo].[vwPendingEquipment]').RequestID = First(PendingEquipmentCollection).RequestID

 

To work around it, I suggest you can remove SQL Connection, then re-connect it and re-create the collection to check if the issue is fixed.


Best regards,

Sik

View solution in original post

2 REPLIES 2
Microsoft v-siky-msft
Microsoft

Re: Filter on Collection not working correctly

Hi @MikeAnderson ,

 

Is there any error information with the formulas? What is data type of ‘Request ID’ column? Is there any value in Request ID Column? Is there any other formulas applied to change the value of collection.

Please check if the RequestID column has been populated with proper value in your Collection?

I have made a test,  and don’t have issue you mentioned. The gallery can be filtered well against the collection.

RequestID  and  TreeGallery_DetailsScreen.Selected.Entity should have same data type. So could you use two Tables to show RequestID column of collection and data source to check if there is any difference between values? Or you can put the below formula to Text property of Label to check if both of them are same.

 

First('[dbo].[vwPendingEquipment]').RequestID = First(PendingEquipmentCollection).RequestID

 

To work around it, I suggest you can remove SQL Connection, then re-connect it and re-create the collection to check if the issue is fixed.


Best regards,

Sik

View solution in original post

MikeAnderson
Level 8

Re: Filter on Collection not working correctly

Well,

 

After the app sat for a day, when I went back in, it is working as expected. No code changes, no tweaks, just worked as it should have worked from the beginning.

 

Thank you for the reply.

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (9,178)