cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FlowMohit
Helper I
Helper I

Unexpected clearcollect behavior for SQL server

Hi All,

 

I am not sure whether it's an expected behavior.

 

I have 2 table in ms sql server. One is called Protocol( Primary Key = Protocol_ID) and other is called LoE(Foreign Key = Protocol_ID). When I am trying to filter LoE items for a specific Protocol_ID using this formula - 

ClearCollect(
colLoEToBeCopied,
Filter('[dbo].[LoE]',Protocol_ID = ctxPLProtocolToBeCopied.Protocol_ID
))

 

My collection looks like this(Columns are returned as empty) -

 

 

 

Issue.PNG

What is wrong here?

2 ACCEPTED SOLUTIONS

Accepted Solutions
timl
Super User
Super User

Hi @FlowMohit 

The first thing I would check is the 'Explicit Column Selection' setting under File > App Settings > Advanced Settings.

image.png

If this is enabled, could you try turning to off see if it makes a difference?

View solution in original post

v-yutliu-msft
Community Support
Community Support

Hi @FlowMohit ,

Please try this formula:

ClearCollect(
colLoEToBeCopied,
Filter('[dbo].[LoE]',Protocol_ID in ctxPLProtocolToBeCopied.Protocol_ID
))

// ctxPLProtocolToBeCopied.Protocol_ID is a table, you need to use "in" to compare a value and a table.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
timl
Super User
Super User

Hi @FlowMohit 

The first thing I would check is the 'Explicit Column Selection' setting under File > App Settings > Advanced Settings.

image.png

If this is enabled, could you try turning to off see if it makes a difference?

v-yutliu-msft
Community Support
Community Support

Hi @FlowMohit ,

Please try this formula:

ClearCollect(
colLoEToBeCopied,
Filter('[dbo].[LoE]',Protocol_ID in ctxPLProtocolToBeCopied.Protocol_ID
))

// ctxPLProtocolToBeCopied.Protocol_ID is a table, you need to use "in" to compare a value and a table.

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,490)