Skip to main content

Notifications

Community site session details

Community site session details

Session Id : /Pg0OETCO9ZJnRfAqsE2l6
Power Pages - Power Apps Portals
Answered

Related Records Filtering on Lookup Field Not Working on PowerApps Portal

Like (0) ShareShare
ReportReport
Posted on 23 May 2020 06:54:27 by

Hello Community,

 

Does anyone know if related records filtering on custom lookup field is supported on PowerApps Portal?

 

The situation I have is that I have created a custom PowerApps portal, connected to my Dynamics 365 instance. In Dynamics 365, I have a Lead entity form where I have created a custom lookup field, let's called it Lookup A. I have set related records filtering on Lookup A, based on another field Lookup B. It's all working successfully as expected on the Lead form in Dynamics.

 

However, the problem occurs when I use the same Lead form on the portal page for user to create the lead record through the portal. On the portal page, when clicking on Lookup A (with Lookup B populated), the related record filtering doesn't work. Instead, there is an error message displayed after clicking on Lookup A, showing "We're sorry, but something went wrong. Please try again, and if this persists, contact the website administrator". And when clicking the filter icon at the top of the popup lookup records window, the error message goes away and display all records in Lookup A, instead of the expected filtered records for selection. Please see screen shots below. 

 

I have contacted Microsoft support on this, but after almost 3 weeks Microsoft still cannot figure this out. This is really puzzling and I can't find any solutions for it. I am not a developer (I don't write codes), and I am really hoping there is a way via configurations to fix this problem without needing to apply any custom codes.

 

Any pointers would be appreciated.

 

Thank you!

Eric

  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on 30 Nov 2021 at 03:30:37
    Re: Related Records Filtering on Lookup Field Not Working on PowerApps Portal

    Hi @Anonymous ,

    This line: 

    $("#dwc_primarycategorization").change();

    is triggering a change event. If you don't want to trigger the change event on form load you can just omit it.

  • Community Power Platform Member Profile Picture
    on 18 Nov 2021 at 09:34:30
    Re: Related Records Filtering on Lookup Field Not Working on PowerApps Portal

    @OOlashyn  

    this code from you blog

     $("#dwc_primarycategorization").change(onPrimaryChange);
     $("#dwc_primarycategorization").change();
     

    is being triggered when the entity form is loaded not when the lookup field is changed.
  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on 02 Jun 2020 at 06:59:45
    Re: Related Records Filtering on Lookup Field Not Working on PowerApps Portal

    Hi @Anonymous ,

     

    In my article I am mentioning two post from Colin Vermander (first and second) where he goes into more details about the method of retrieving data. In short: you need to create a web page where underlying web template will have a required fetchxml query that can receive parameters and will act as your API. So just create a web page with that web template and call it from javascript.

  • Community Power Platform Member Profile Picture
    on 02 Jun 2020 at 03:49:51
    Re: Related Records Filtering on Lookup Field Not Working on PowerApps Portal

    Hi @OOlashyn ,

     

    Thanks again for your information on this. I would like to circle back on this topic as I have a follow-up question after going through the blog you have shared. In the blog, it says we will need to create a web template with correct fetchxml query that will receive as a parameter id of the main dropdown and will return us a list of records that we will add to our select. It then provides a sample of the code to be used in the web template.

     

    My question is: where and how should I apply this web template? Do I simply add the new web template?

     

    Thanks!

  • v-xida-msft Profile Picture
    on 25 May 2020 at 02:02:40
    Re: Related Records Filtering on Lookup Field Not Working on PowerApps Portal

    Hi @Anonymous ,

    I agree with @OOlashyn 's thought almost. Currently, the Related record filtering works only on edit forms.

     

    If you want to filter a LookUp field based on another LookUp field in your PowerApps Portal Entity form, please check the following blog:

    https://www.dancingwithcrm.com/custom-lookup-filtering-powerapps-portal/

     

    More details about using FetchXML Query to retrieve Entity records from CDS Entity, please refer to the following article:

    https://docs.microsoft.com/en-us/powerapps/developer/common-data-service/use-fetchxml-construct-query

     

    Best regards,

  • Community Power Platform Member Profile Picture
    on 23 May 2020 at 13:28:27
    Re: Related Records Filtering on Lookup Field Not Working on PowerApps Portal

    Thanks for your reply and sharing the information! I am very surprised that this is a gap on the portal functionality. I would have expected this to behave the same as the form in Dynamics 365...

     

    But thank you for sharing your blog post! I will look into this accordingly.

  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on 23 May 2020 at 11:32:42
    Re: Related Records Filtering on Lookup Field Not Working on PowerApps Portal

    Hi @Anonymous ,

     

    Unfortunately, related lookup filtering on the portal works only on the edit forms. I found a custom workaround - using liquid page template and render lookups as a select dropdown and replacing values with javascript code. You can find a detailed description of how you can do it in my blog post

     

    Hope this will help.

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,786 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,093 Most Valuable Professional

Leaderboard