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

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,

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. 

4 REPLIES 4
v-xida-msft
Community Support
Community Support

Hi @sangeetha_sn ,

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

 

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

 

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.

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

Anonymous
Not applicable

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

fdebriey
New Member

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

 

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.

 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,571)