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

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

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

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

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,767)