Skip to main content

Notifications

Community site session details

Community site session details

Session Id : C/A+zs4OCTk41dWdsm4KmX
Power Apps - Building Power Apps
Unanswered

Subgrid - how to filter the records shown in the 'add new from existing' button based on a field in the entity to which the grid value is related to

Like (1) ShareShare
ReportReport
Posted on 20 Apr 2020 09:22:53 by

Hi,

Thank you in advance if you can come up with a solution to this.Hope I have explained my scenario well.Will greatly appreciate if you can help me out soon here:)

 

I have three entities. Entity A,B and C . C is related to A. and B is related to A. Depending on the value of A within B,the multiple records from C which falls under A should be listed for user to choose from. There is a subgird within A whose datasource is C. There is a subgrid in B whose datasource is C. The view is set such as to 'show only related records'.Entity B has a lookup field which has value of A in B. According to that data,the list of values to choose from for B regarding C is to be filtered. I have been looking into this since a couple of days now.Can anyone help me? C has many-many relationship with A,B ( inorder to include subgrid component in the form)B has many to one relationship with A. C depends on the A. 

  • fdebriey Profile Picture
    2 on 16 Dec 2020 at 07:24:09
    Re: Subgrid - how to filter the records shown in the 'add new from existing' button based on a field in the entity to which the grid value is related to

    Hi,

     

    The only solution I know of is is using javascript to "replace" the "Add existing" button behaviour. I have never tried...

     

    One example:
    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/250722/filtered-lookup-for-add-existing-button-for-many-to-many-relationship?pifragment-97030=1

     

    But definitely :

    MS needs to extend M-M Subgrid "Add existing" button "Lookup View" filtering by allowing to define a filtering comparable to what can be done with a Lookup field directly on a Form.

     

  • Community Power Platform Member Profile Picture
    on 02 Aug 2020 at 07:13:14
    Re: Subgrid - how to filter the records shown in the 'add new from existing' button based on a field in the entity to which the grid value is related to

    wanting a solution to this too - we are wanting 'Related Records Filtering' for the subgrid component

  • Community Power Platform Member Profile Picture
    on 22 Apr 2020 at 07:03:12
    Re: Subgrid - how to filter the records shown in the 'add new from existing' button based on a field in the entity to which the grid value is related to

    Hi @v-xida-msft ,

     

    Thank you the reply.Let me try to give you a better understanding of my scenario.

     

    Dynamic Filter on Sub grid look up 

     

    What I want to achieve is the filtering of data list in the inline lookup of Sub grid component.

     

    The  three entities Idea,Department and Expected Result. A department can have multiple expected results. An idea falls under a department.The user should be able to add multiple expected results to an Idea .The option list of expected results listed in Idea's subgrid inline lookup should be based on the department of the Idea.

     

    I am developing the App using the Innovation Challenge template provided in the App list in the PowerApps maker portal

     

    App type: Model driven app

    My account plan: Power Apps Per User Plan trial

  • v-xida-msft Profile Picture
    on 21 Apr 2020 at 04:18:31
    Re: Subgrid - how to filter the records shown in the 'add new from existing' button based on a field in the entity to which the grid value is related to

    Hi @Anonymous ,

    Could you please share a bit more about your scenario?

    Do you want to filter the LookUp field available options within your Entity B Form based on the SubGrid related to Entity C?

     

    Based on the needs that you mentioned, I think the "Related Records Filtering" option for the LookUp field (refer to Entity A) in your Entity B could achieve your needs.

     

    You could consider consider edit your Edit B form in classic mode experience, then double click the LookUp field (refer to Entity A), then configure "Related Records Filtering" option for it:

    5.JPG

    Please check and see if the following two blogs would help in your scenario:

    https://carldesouza.com/filtering-lookup-fields-in-dynamics-365/

    https://www.arbelatech.com/insights/blog/how-to-filter-lookups-without-custom-code-in-dynamics-365-customer-engagement.html

     

    Also please check and see if the following thread link would help in your scenario:

    https://powerusers.microsoft.com/t5/Common-Data-Service-for-Apps/Cascading-filters-to-guide-foreign-key-Selection-in-Model-Driven/m-p/462183

     

    Best regards,

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,743 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,083 Most Valuable Professional

Leaderboard
Loading started