Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

FetchXML using selected value of another field

(0) ShareShare
ReportReport
Posted on by 306

In my model-driven app, I'm using a PCF control "N to N Multiselect" on a form and I want to filter the options available in it based on the selected value of another field (a lookup) on the form.  The PCF control settings has an option to use a FetchXML Webresource for filtering the data.  How to I create FetchXML that looks at the selected value of the other field?

  • tschopp Profile Picture
    306 on at
    Re: FetchXML using selected value of another field

    Hi @DianaBirkelbach ,

    I haven't gotten this to work yet.  It sounds like you can't compare columns across entities.  I'm thinking I'll need a javascript solution.

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: FetchXML using selected value of another field

    Hi @tschopp , 

     

    Did this solved your issue? Were you able to solve it different?

     

    Kind regards,

    Diana

  • Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at
    Re: FetchXML using selected value of another field

    Hi @tschopp , 

    I had a look on the blog about the control: https://www.itaintboring.com/dynamics-crm/is-it-a-multiselect-optionset-nope-its-an-nn-lookup/ . In the comments below it, it seems that somebody solved the problem with a PlugIn registered on RetrieveMultiple.

     

    I'm thinking if it would be possible to solve your problem by defining the FetchXml with an extra "linked-entity" to the parent entity. Using the ColumnComparison in FetchXML (https://markcarrington.dev/2020/07/15/column-comparisons-in-fetchxml/?utm_campaign=Power%20Platform%20Developers%20Weekly&utm_medium=email&utm_source=Revue%20newsletter) you should be able to make a condition comparing with the parent entity attributes. That would filter the records as you need, right?

    Not sure if it works,  since I have't used the control.

     

    Hope it helps!

     

    Kind regards,

    Diana

     

     

     

  • magesoe Profile Picture
    80 on at
    Re: FetchXML using selected value of another field

    You have an inherit problem in that the PCF is probably bound statically to the Fetchxml, but you want it to be changed dynamically.

     

    You could take a field value as an input by bounding the PCF to a field and do the filtering that way. That means you have to copy the PCF and modify the code to your needs

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

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

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 109 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 82 Super User 2025 Season 1

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 72

Overall leaderboard