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

Filter CDS DataSource

Hello 

 

Does anyone know if there's a possibility to filter a cds datasource using "=" instead of "in"?

 

My filter function currently looks like this:

Filter(
'CDSList',
'CDSList (Views)'.'68de3a97-16c5-e911-a98b-000d3ab0f1d7',
cr061_articleid in galArticles.Selected.cr061_Article_cr061_code_cr061_code.cr061_articleid
)

cr061_Article_cr061_code_cr061_code is a many-2-many related entity.

 

Why can't I just use "=" instead of "in"?

 

I think the current formula is not reliable.

 

Thanks.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter CDS DataSource

Hi @MarcoLotscherNC ,

Based on the issue that you mentioned, I think you have some misunderstanding on the Filtered column comparison in Filter function.

 

When you use Filtered column to compare with a specific value in a Filter function, the Filter function would compare the Filtered column of each record with the specific value, then find the matching records.

 

Within your Filter formula, the cr061_articleid column value of each record in your 'CDSList' Entity should be compared with the galArticles.Selected.cr061_Article_cr061_code_cr061_code.cr061_articleid formula result. The  cr061_articleid column value may be a GUID value (single value), but the result the galArticles.Selected.cr061_Article_cr061_code_cr061_code.cr061_articleid formula returned is a Table value, you could not use '=' operator to compare with a single value (e.g. GUID value) with a Table value.

 

More details about operators supported in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/operators

 

Best regards,

Community Support Team _ Kris Dai
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

4 REPLIES 4
Microsoft dinusc
Microsoft

Re: Filter CDS DataSource

Hello @MarcoLotscherNC ,

I don't see why you would not be able to use "=" instead of "in". Are you getting any errors with "="? Please note that the "=" operator is case sensitive (aBc is not equal to Abc).

Community Support Team
Community Support Team

Re: Filter CDS DataSource

Hi @MarcoLotscherNC ,

Based on the issue that you mentioned, I think you have some misunderstanding on the Filtered column comparison in Filter function.

 

When you use Filtered column to compare with a specific value in a Filter function, the Filter function would compare the Filtered column of each record with the specific value, then find the matching records.

 

Within your Filter formula, the cr061_articleid column value of each record in your 'CDSList' Entity should be compared with the galArticles.Selected.cr061_Article_cr061_code_cr061_code.cr061_articleid formula result. The  cr061_articleid column value may be a GUID value (single value), but the result the galArticles.Selected.cr061_Article_cr061_code_cr061_code.cr061_articleid formula returned is a Table value, you could not use '=' operator to compare with a single value (e.g. GUID value) with a Table value.

 

More details about operators supported in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/operators

 

Best regards,

Community Support Team _ Kris Dai
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

MarcoLotscherNC
Level: Powered On

Re: Filter CDS DataSource

Thank you for your explanation.

 

Hence I should change the formula to:

Filter(
                'Articles',
                'Articles (Views)'.'68de3a97-16c5-e911-a98b-000d3ab0f1d7',
                cr061_articleid = First(galArticles.Selected.cr061_Article_cr061_code_cr061_code).'ArticleID'
                
            )

I thought the galArticles.selected would return only one record.

 

 

Community Support Team
Community Support Team

Re: Filter CDS DataSource

Hi @MarcoLotscherNC ,

Yeah, you are right.

 

Have you solved your problem? Or the solution I provided above is helpful in your scenario?

 

If you have solved your problem, please consider go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

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

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,884)