web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Why doesn't this expre...
Power Apps
Answered

Why doesn't this expression work?

(0) ShareShare
ReportReport
Posted on by 35

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'
 )
)
Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @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."

     

  • rmeany Profile Picture
    35 on at

    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'
     )
    )
  • mdevaney Profile Picture
    29,993 Moderator on at

    @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'?

  • rmeany Profile Picture
    35 on at

    '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.

  • mdevaney Profile Picture
    29,993 Moderator on at

    @rmeany 

    So is it a Sharepoint LookUp column?

  • rmeany Profile Picture
    35 on at

    No, it's accessing common data services entities.

  • mdevaney Profile Picture
    29,993 Moderator on at

    @rmeany 

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

  • rmeany Profile Picture
    35 on at

    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...

  • Verified answer
    rmeany Profile Picture
    35 on at

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 409 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 252 Most Valuable Professional

Last 30 days Overall leaderboard