I have asked sort of the same question earlier but a bit too complicated I am afraid.
So I try to make is as simple as possible.
Table: Parent(s)
Table: Child(ren)
In table Children a relation is defined many to one to table Parents.
Table Childrens now says there is a relation many to one, there is a lookup field Parent
Table Parents now says there is a relation one to many, relation is called Parent
In a gallery of parents I want to show the number of children a parent has
CountRows(Filter(Children;Parent=ThisItem.Parent))
Whatever I do it will not work. ThisItem.Parent is valid (shows as GUID in a label). In another gallery showing Children I have one Child with a valid Parent. ThisItem.Parent.Parent shows the right GUID
The identifiers are correct / not red underlined but there is a red line under "=" (invalid argument type)
In my case the names ot tables and fields are different but I wanted to make this as simple as possible.
Should this code work?
If so then some disambiguation is probably in order and I would like to know how I can disambiguate this statement as much as possible.
I also find that the code
First(Filter(Children;cra27_Parent.cra27_parentid=ThisItem.Parent)).Naam
insode will not work
But outside the gallery
First(Filter(Children;cra27_Parent.cra27_parentid=GalleryParents.Selected.Parent)).Naam
will work
The cra27_ bit is added by PA. My code was Parent.Parent (relation name.field name) Autodisambiguation?