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

Filtering lookup field based on lookup field in another entity

Hi everyone 🙂 

 

I am currently working on a model driven app solution and think I might have got in a bit of a mess with my table relationships.

 

What I am trying to achieve is:

I have a table for Tickets - the ticket is related to a client, one client can have many tickets.

Within a ticket, I have a number of Patch Installations. Within a patch installation record, a user will pick a device from a dropdown list (which should be filtered based on the Ticket's client)

All they need to then do is add a patch date, and whether it was successful or failed.

 

My challenge is my relationship between my device and ticket client. 

 

So, in my ticket entity I fill out the details including the managed services client, save the record, then go to add patch installations:

chloelawr_0-1627398617667.png

 

Then when I do my quick create, I should have a list of Devices which are related to the client, however it is pulling through all devices and not filtering them.

chloelawr_1-1627398691907.png

 

I have tried going and amending the related records filtering here:

chloelawr_2-1627398750502.png

I think what I want to be able to select is:

Only show records where: Ticket (Managed services client)

Contains: Devices

 

So I think there is something wrong with my relationships, or perhaps I'm getting the wrong end of the stick and this isn't possible without custom code.

 

Would really appreciate some help on this please as I think I could be missing something really obvious! 

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @chloelawr,

 

Sorry for the delay in getting back to you.

 

Unfortunately to get that related record to filter, your Patch Installation record will need to have the Client lookup. Fortunately you can auto populate the Client lookup based on what is in your Ticket record through column mappings in the N:1 relationship between Ticket and Patch Installation. Note you'll need to Switch to Classic to configure this.

 

ChrisPiasecki_0-1627655032729.png

 

When you add a Patch Installation from a subgrid  on Ticket, it will auto populate the client lookup. Note that you must always be coming from a related record (e.g. subgrid, associated view) so that it knows how to map it. This will work from the user interface only, so if the record is being created in another way, it won't automatically be mapped. I would suggest using a Dataverse workflow to populate the client lookup based on the parent Ticket.

 

Hope this helps.

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

5 REPLIES 5
ChrisPiasecki
Super User
Super User

Hi @chloelawr,

 

This should filter as desired. When you are creating the Patch Installation record and looking at the Device lookup, has the Client lookup on the record already been set?

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

Hi Chris,

 

Thanks for getting back so quickly.

 

This was another bit I'm unsure of..

In the filtering example, you can see that I actually added the manual patch client into the patch installation record as a lookup field just to see what happened. 

I can then filter the managed services client lookup when creating a patch installation, however I still need to select the client from the dropdown list even though it is currently a 1:N relationship from client to patch record. 

 

Ideally I don't think the Client needs to be part of the patch installation form because I'd prefer the relationship to just be linked from ticket > client > patch devices rather than needing to duplicate and put the client against the ticket and the patch installation. 

 

If that's not possible, is there a way I can just auto populate the client dropdown in the patch record so the user doesn't actually need to select it from the list? I tried a business rule however that is giving me a circular relationship error 

 

so to summarise, at the moment, yes it is working where my devices are filtered based on the managed services client selected in the patch installation.. but I want it to be either pulling from the ticket's client, or for the patch record client to be auto populated based on the ticket's client.

 

I hope all of that makes sense? 🙂 

chloelawr
Regular Visitor

Hi @ChrisPiasecki, sorry I didn't tag you in my last post so I'm not sure whether you saw it?

Happy to reach out to the rest of the community on this if you're not too sure 🙂  

Hi @chloelawr,

 

Sorry for the delay in getting back to you.

 

Unfortunately to get that related record to filter, your Patch Installation record will need to have the Client lookup. Fortunately you can auto populate the Client lookup based on what is in your Ticket record through column mappings in the N:1 relationship between Ticket and Patch Installation. Note you'll need to Switch to Classic to configure this.

 

ChrisPiasecki_0-1627655032729.png

 

When you add a Patch Installation from a subgrid  on Ticket, it will auto populate the client lookup. Note that you must always be coming from a related record (e.g. subgrid, associated view) so that it knows how to map it. This will work from the user interface only, so if the record is being created in another way, it won't automatically be mapped. I would suggest using a Dataverse workflow to populate the client lookup based on the parent Ticket.

 

Hope this helps.

 

---
Please click Accept as Solution if my post answered your question. This will help others find solutions to similar questions. If you like my post and/or find it helpful, please consider giving it a Thumbs Up.

View solution in original post

chloelawr
Regular Visitor

@ChrisPiasecki I'm chuffed!! That's exactly what I wanted to do.. I never even knew about column mapping before so that will help me so much in the future as well.

 

Massively appreciate your help.. thank you! 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Users online (2,659)