I have been facing
a lot of issues when interacting with many-to-many related Dataverse tables within PowerApps. Mainly, that I am running into a lot of issues when trying to reference relationships in iterating functions like
Filter() and ForAll(). I have attempted to simplify the environment I'm working with, just to figure out how to accomplish what I'm looking for: I want to be able to tell if I record is related to multiple other records.
While seemingly straightforward, I keep running into the error of: The specified column is not accessible in this context. whenever I try to reference these relationships.
In my example, I have three tables, People, Fruit, and Hobbies, with People being related many-to-many to the other two (Fruit and Hobbies are not related).
After creating a few relationships with galleries and
Relate(), I was able to see things like what fruits are liked by selected people, and what people like what hobbies with simple relationship accessors inside of galleries with statements like
PeopleBox.Selected.Fruit, HobbiesBox.Selected.People, etc. These return very straightforward tables of related records:
However, I cannot figure out how to do something like simply making a table of all people who are related to two selected records. Since it would no longer be the people related by a single relationship accessor (if anything would be the intersection between the two resulting tables), my thought was to filter all people by if these relationships exist. However, there for some reason is a missing IsRelated() function, that would help tremendously for things like this. My next thought was to instead use record GUID's, and simply filter based on if the current record's GUID matches those referenced within the selected Fruit and Hobbies referenced People:
Unfortunately, this doesn't evaluate correctly because I'm also running into issues using LookUp() on relationship columns:
These should both evaluate to the same value; they both reference the People record with name Billy, but for some reason the LookUp() statement returns blank.
Here's another example of where I run into the non-accessible message I mentioned previously:
I expected that this ForAll() statement would return a single-column table of tables, each corresponding to a single Fruit's related People records.
It seems like I'm either navigating these relationships entirely wrong or they aren't fleshed out in PowerFX. Any tips would be awesome!