diff --git a/internal/powerplatform/services/data_record/api_data_record.go b/internal/powerplatform/services/data_record/api_data_record.go index 5a9895ec..631c0148 100644 --- a/internal/powerplatform/services/data_record/api_data_record.go +++ b/internal/powerplatform/services/data_record/api_data_record.go @@ -235,11 +235,11 @@ func (client *DataRecordClient) GetEntityRelationDefinitionInfo(ctx context.Cont } for _, list := range manyToMany { item := list.(map[string]interface{}) - if item["Entity1NavigationPropertyName"] == relationLogicalName { + if item["Entity1NavigationPropertyName"] == relationLogicalName && item["Entity1LogicalName"] != entityLogicalName { tableName = item["Entity1LogicalName"].(string) break } - if item["Entity2NavigationPropertyName"] == relationLogicalName { + if item["Entity2NavigationPropertyName"] == relationLogicalName && item["Entity2LogicalName"] != entityLogicalName { tableName = item["Entity2LogicalName"].(string) break }