- Child Account A
- Child Account B
- Child Account C

This is a classic N:N relationship filtering scenario in Dataverse, and you’re very close — you just need the correct relationship chain.
Your data model looks like this:
Opportunity
↓
Opportunity Account (intersect table)
↓
Account (child)
↓
Contact
What you want is:
Show all contacts belonging to the child accounts that are linked to the current opportunity.
You should not try to do this with FetchXML manually in the form or with JavaScript.
Dataverse already supports this using related tables + filtering.
You must have:
Opportunity → Opportunity Account
(1:N)
Opportunity Account → Account
(N:1)
Account → Contact
(1:N, standard relationship)
No custom logic required.
On the Opportunity main form:
Insert Subgrid
Table: Contacts
View: any active contacts view
Now click Edit related records filtering.
Choose:
Show only related records
Then select this chain:
Contact
→ Parent Customer (Account)
→ Opportunity Accounts
→ Opportunity
And set:
Opportunity = Current Opportunity
This tells Dataverse:
“Show contacts whose parent account is linked to this opportunity through the Opportunity Account table.”
If your Opportunity has:
Child Account A
Child Account B
Child Account C
The subgrid will automatically show:
All contacts from Account A
All contacts from Account B
All contacts from Account C
No duplicates, no code, no flows.
Model-driven apps use relationship traversal, not joins you write manually.
Behind the scenes Dataverse generates FetchXML similar to:
Contact
→ Account
→ OpportunityAccount
→ Opportunity
You just define the relationship path once in the subgrid.
❌ JavaScript filtering
❌ Custom FetchXML web resources
❌ Power Automate to copy contacts
❌ Duplicate contact records
❌ Rollup fields
All unnecessary.
(Contacts linked only to Contacts or Leads will not appear.)
(Not a lookup field stored on Opportunity.)
When users open the Opportunity:
They select child accounts via Opportunity Accounts
The embedded Contacts grid dynamically updates
Any contact added to those accounts automatically appears
No sync, no code, no maintenance
Opportunity Products
Quotes → Quote Lines
Account Teams
Access Teams
You’re modeling it correctly — you just needed the related-record filter path in the subgrid.