cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Super User
Super User

Re: Unexpected clearcollect behavior for SQL server

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

Highlighted
Community Support
Community Support

Re: Unexpected clearcollect behavior for SQL server

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
Highlighted
Super User
Super User

Re: Unexpected clearcollect behavior for SQL server

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

Highlighted
Community Support
Community Support

Re: Unexpected clearcollect behavior for SQL server

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

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

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

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 (12,423)