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 Pages / Related Records Filter...
Power Pages
Unanswered

Related Records Filtering on Lookup Field Not Working on PowerApps Portal

(0) ShareShare
ReportReport
Posted on 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

Categories:
I have the same question (0)
  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    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.

  • Community Power Platform Member Profile Picture
    on at

    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.

  • v-xida-msft Profile Picture
    on at

    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 at

    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!

  • Verified answer
    OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    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 at

    @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.
  • OOlashyn Profile Picture
    3,496 Most Valuable Professional on at

    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.

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 Pages

#1
Jerry-IN Profile Picture

Jerry-IN 71

#2
Fubar Profile Picture

Fubar 62 Super User 2025 Season 2

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard