cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

Why doesn't this expression work?

I'm trying to create a collection that contains a list of inventory models belonging to a certain item type when a user selects the item type from a dropdown.  This query returns a zero-sized collection every time though, even though there are definitely items of the type I selected from the dropdown.. 

ClearCollect(
    ModelTypesFilter,
    Filter(
        'Inventory Item Models',
        'Inventory Item Type'.'Type Name' = drpItemType.Selected.'Type Name'
    )
)
1 ACCEPTED SOLUTION

Accepted Solutions
Frequent Visitor

I'm giving up on CDS for now.. Just doesn't seem fully implemented yet to me..  

View solution in original post

9 REPLIES 9
Super User III
Super User III

@rmeany 

At least one of the Filter criteria must reference the datasource being filtered 'Inventory Item Models'.  Nothing will show if you try to Filter a datasource according to 'Inventory Item Type'

 

ClearCollect(
    ModelTypesFilter,
    Filter(
        'Inventory Item Models',
        'Inventory Item Type'.'Type Name' = drpItemType.Selected.'Type Name'
    )
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

Ahh, I thought that the filtered table would be implied in the filter expression if not specified, but I also tried the following and it still does not work:

 

ClearCollect(
    ModelTypesFilter,
    Filter(
        'Inventory Item Models',
        'Inventory Item Models'.'Inventory Item Type'.'Type Name' = drpItemType.Selected.'Type Name'
    )
)

@rmeany 

I am little bit confused now.  I thought 'Inventory Item Type' was a datasource name but now it seems to be a column.  What column type is 'Inventory Item Type'?

'Inventory Item Type' is a foreign key reference to the 'Inventory Item Types' table..

 

An item model (example: HP EliteDesk 800) has a type (example: desktop computer) ...  Desktop computer can belong to many different models.

@rmeany 

So is it a Sharepoint LookUp column?

No, it's accessing common data services entities.

@rmeany 

Sorry, I am not yet familiar with Common Data Service.

When I try to reference the parent table in the collection, the data type of foreign key column is actually a record itself.. I'm guessing it's supposed to be returning the actual record in the parent table...  But referencing it this way seems to be returning a blank record for some reason...

 

First('Inventory Item Models').'Inventory Item Type' = blank even though I know every model in my database has a type associated with it...

Frequent Visitor

I'm giving up on CDS for now.. Just doesn't seem fully implemented yet to me..  

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

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

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,460)