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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Filtering Dataverse da...
Power Apps
Unanswered

Filtering Dataverse data by related table in Canvas app

(0) ShareShare
ReportReport
Posted on by 83

I am loading data from a table into a collection. I would like to be able to filter those items at load time based on a related table.

 

The table itself is called "Topics" and the related table is called "Topic state".

 

The "Topic state" holds data for the built-in stage/gate functionality in Model-driven Power Apps

 

jrossstocholm_0-1708594539350.png

I would like to filter my Topics such that Topics with a specific state is not included. In the Model-driven Power App I have created a View that does just that:

jrossstocholm_1-1708594659403.png

My current filter - that does not take into account the data in the related table - looks like this:

ClearCollect(topics_all,Filter(Topics, 'Show in pipeline' = 'Show in pipeline (Topics)'.Yes && Not(Status = 'Status (Topics)'.Inactive)));

 

How do I augment this to include the related table?

I can download the "FetchXml" from the View - it is possible to use that data in the filter in my Canvas app?

 

Thanks,

Jesper 😊

 

I have the same question (0)
  • Jonathan Manrique Profile Picture
    2,687 on at

    Hi @jrossstocholm 

     

    You must add one more filter where you attack the Topic State table and filter by the GUID of the Topic table record and then also have another filter parameter where Active State <> Topic present.

     

    ClearCollect(topics_all,Filter(Topic State(Filter(Topics, 'Show in pipeline' = 'Show in pipeline (Topics)'.Yes && Not(Status = 'Status (Topics)'.Inactive)));Guidtopic = TopicState.topic;ActiveStage <> TopicPresent)) 

     

     

  • ivan_apps Profile Picture
    2,187 Moderator on at

    If you have created the view in the Dataverse table already, why not just reference that view in your filter? Take a look at this article, it shows you how to use that existing view in your canvas app.

     

    http://powerappsguide.com/blog/post/how-to-create-and-use-dataverse-views

     

    Video walkthrough: https://youtu.be/eKygMP7ySR8?si=UunLz-EkSR3tW0xT

  • JS-05081236-0 Profile Picture
    83 on at

    I have previously had some issues with loading data from a View into a Collection.

     

    Solved: Re: Loading Dataverse data into collection does no... - Power Platform Community (microsoft.com)

     

    I will look into it again to see if I can make it work this time. It would be considerably easier to just use the predefined view.

  • ivan_apps Profile Picture
    2,187 Moderator on at

    Ah ok I see. So I think you want to use that filter but ultimately have your table show data from both you primary table and the business process flow table associated with it. In that case either you can do an ‘AddColumn’ to add the associated record as a column to your collection, or just use a Lookup() inside your gallery to retrieve that info per row. Basically this is the equivalent of a SQL join which should be achievable. This other community post and answer does a great job of explaining the ways to do a join:

     

    https://powerusers.microsoft.com/t5/Building-Power-Apps/Syntax-for-joining-tables/td-p/61387

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard