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

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
v-siky-msft
Level 10

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
v-siky-msft
Level 10

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: Powered On

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
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

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