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

Filter LookUp Field to Related Record From Previous LookUp Field

Hey, I was working on this form in model driven apps with two look up field which is hazard category and hazard sub category where i want to only show hazard subcategory records that are related to the hazard category. For example if i choose Hazard 1, i want to only show the record Sub Hazard 1.1. Is there any possible way to achieve that? Thanks in advance!

bsakura_0-1602652851313.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
EricRegnier
Super User II
Super User II

Hi @bsakura,

Yes it is possible out-of-the-box. Here are the steps:

  1. In make.powerapps.com, navigate to your Entity --> Forms and open the desired form
  2. Switch to Classic form designer by clicking the "Switch to Classic" button in the command bar
  3. Select the lookup field and click "Change Properties" in the ribbon
  4. Under the "Related Records Filtering", check "Only shows records where"
  5. Pick the Category lookup field  in the dropdown then in "Contains" the Category related field
    2020-10-14_20-51-54.png
  6. I would uncheck "User can turn off filter" so users can't turn off and pick un related sub-categories
  7. Click OK, Save All and Publish

 

Note: a small caveat is that it expects the main Category to be selected before the sub-category.

 

Hope this helps!

View solution in original post

4 REPLIES 4
EricRegnier
Super User II
Super User II

Hi @bsakura,

Yes it is possible out-of-the-box. Here are the steps:

  1. In make.powerapps.com, navigate to your Entity --> Forms and open the desired form
  2. Switch to Classic form designer by clicking the "Switch to Classic" button in the command bar
  3. Select the lookup field and click "Change Properties" in the ribbon
  4. Under the "Related Records Filtering", check "Only shows records where"
  5. Pick the Category lookup field  in the dropdown then in "Contains" the Category related field
    2020-10-14_20-51-54.png
  6. I would uncheck "User can turn off filter" so users can't turn off and pick un related sub-categories
  7. Click OK, Save All and Publish

 

Note: a small caveat is that it expects the main Category to be selected before the sub-category.

 

Hope this helps!

View solution in original post

Dear @EricRegnier , Thank you for your answer, that resolved my question!

@EricRegnier I know this is almost a year old, but I was wondering if you had some additional insight about this. After enabling Related Record Filtering (which does exactly what I need), then any changes on the main form editor will 'overwrite' it, so to speak.

 

For example, if Related Record Filtering is enabled and then another change is made on the main form editor, and then saved and published, the Related Record Filtering will actually turn off. Is there any way to prevent this from happening?

Hi @sruvira,

No, it shouldn't turn it off again, unless someone else are you are working with an old version that has it off. Make sure every time you need to update a form that you load the latest form changes, so don't update a form where the form editor was previously opened. Another tip is always publish your form changes when done.
BTW I just tried it and it works as expected for me.

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,022)