cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Check this Out

Announcing

Class of 2020- Season 2

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,848)