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?
Solved! Go to Solution.
I got it working in the end
Filter(DrawingRegisterParts,ProjectGlobalCode.GlobalCode=ThisItem.GlobalCode)
I got it working in the end
Filter(DrawingRegisterParts,ProjectGlobalCode.GlobalCode=ThisItem.GlobalCode)
User | Count |
---|---|
253 | |
109 | |
92 | |
48 | |
37 |