cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
silaman
Resolver I
Resolver I

Dataverse table relationships shown in parent and child galleries on each parent row

I have a projects table (DrawingRegister) and a parts table (DrawingRegisterParts), there can be many parts to a project, 1toN, a look up in the parts table references the projects table

 

I have a flexible gallery that lists the DrawingRegister, each row now has another gallery drop down which has to show the parts.

 

I want the child gallery to show the parts based on the relationship to that item. Not every project has parts, so some galleries will be blank on some rows which is fine.

 

I can't find exactly what I need to do especially code wise.


It seems I need to load the parts gallery for each row and then filter based on the relationship, which sounds clunky.

At the moment I am using something like this, but it doesn't work.

I am filtering the DrawingRegisterParts table via its ProjectsGlobalCode column which is a lookup that references the parent DrawingRegister table, it always ends up having a record to text comparison issue, no matter what I try.

 

 

 

Filter(DrawingRegisterParts, ProjectGlobalCode = GalRegister.Selected.GlobalCode)

 

 


Even when I reference the filter to a label on the parent item, it gets upset saying it can't compare a record to text, even though they're both text.

 

 

 

Filter(DrawingRegisterParts, ProjectGlobalCode = RegGlobalCodeLab_1.Text)

 

 

 

When I do the below it says it can't because I'm creating a circular reference.

 

 

 

Filter(DrawingRegisterParts, ProjectGlobalCode.Value = GalRegister.Selected.GlobalCode)

 

 


Having an on select for the parent to create a var to which is then used as reference won't work eithe

 

 

 

Filter(DrawingRegisterParts, ProjectGlobalCode = varRegSelected.GlobalCode)

 

 


The below is an attempt to use a label inside the parent item, being the global code, to then filter the parts,  doesn't work either.

 

 

 

Filter(DrawingRegisterParts, ProjectGlobalCode = 'RegGlobalCodeLab_1'.Text)

 

 

 

Is there a way to wrap the record or the (ProjectGlobalCode) I try .value or .text or even {value: } and that doesn't work either.

This doesn't work either

 

 

Search(DrawingRegisterParts, RegGlobalCodeLab_1.Text,"cr36e_ProjectGlobalCode")

 

 


I can have the entire DrawingPartsList come up inside every child gallery for the parent gallery no worries, but as soon as I want to filter it using values from the parent selection DrawingRegister, it won't have a bar of it.

Even when I use this 

 

LookUp(DrawingRegisterParts, cr36e_projectno = varRegSelected.ProjectNo)

 


I don't get any errors, yet it does nothing. I am now using another column which is the project code, which is separate to the global code. The onselect of the parent generates the varRegSelected, which is used to filter the child table, but it does nothing and no errors, even though they both have a ProjectNo column with cross referenceable project numbers. 

I have also tried refreshing the sources

 

What would you do?

1 ACCEPTED SOLUTION

Accepted Solutions
silaman
Resolver I
Resolver I

I got it working in the end

 

 

Filter(DrawingRegisterParts,ProjectGlobalCode.GlobalCode=ThisItem.GlobalCode)

 

 

 

View solution in original post

1 REPLY 1
silaman
Resolver I
Resolver I

I got it working in the end

 

 

Filter(DrawingRegisterParts,ProjectGlobalCode.GlobalCode=ThisItem.GlobalCode)

 

 

 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,612)