@Michael E. Gernaey, thanks again for taking the time to investigate this and trying to help. This is very much appreciated.
Both entities A and B have a many-to-one relationship with entity C, but on top of that - entity A also has a many-to-one relationship with entity B.
The subgrid is for entity A, and one of the columns in this subgrid is the lookup to entity B. In this column I want the user to see only B items that are related to the same C item that A is related to.
Back to entity names (you can now refer to the screenshots in my first post), a Project Mat is related to an Estimate. In the Estimate form I have a Project Mats subgrid. One of the columns in the subgrid is for a Project Phase, because a Project Mat is also related to a Project Phase. Now, because every Project Phase is also related to an Estimate - I want the user to be able to select only a Project Phase that is also related to the same Estimate as the Project Mat.
This desired behavior might be complicated to explain in plain words, but is a very basic requirement, therefore it has a section of its own for lookups in Forms. See the Filtering section in the Phase Lookup properties:
This is exactly the filtering capability I'm trying to achieve - with one difference: I want it to work in the subgrid of Project Mats and in addition to the Project Mat form.
As mentioned (with screenshots) in my original post, this is possible through UI for the old Editable Grid (which has bad UI, therefore I'm trying to avoid it). For the new modern Power Apps Grid - the modern UI doesn't have this feature. The classic designer for this grid does have this feature, but it does not take effect in practice.
If you survived this second round of explanations (which entitles you a medal even before answering) - it probably verified for you that yes, I want to pre-filter for the user. I don't want to user to see irrelevant options and filter them by themselves.
I tried the JavaScript approach with the help of some articles and Co-Pilot (specifically, the OnRecordSelect event), but got stuck because apparently the modern Power Apps Grid does not expose the
type (e.g., a lookup) of controls in the API, and therefore methods like the addCustomFilter cannot be used here, as mentioned (and verified by me) in
this post ("a lookup control doesn’t have the addCustomFilter method, so we cannot implement filtered lookup functionality on Power Apps grid controls").
And the PCF way is out of my scope for now...
Thanks,
Gil.