Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Query Dynamics 365 CE data with filter using n:n relationship

In Dynamics 365 CE there is a possibility in Advanced Find to query for records that have (or don't have) related records in a n:n relationship.


For example: I can show all User records that have Security Roles associated to it.


Now I want to create a Flow that updates all of the found User records.


How can this be archived?


Does Flow provide the possibility to use a similar filter?

Community Support
Community Support

Hi @mgr,


Could you please explain more details about the n:n relationship that you mentioned?

Or could you please share a details example about your requirements?


Please share more details so we would try to provide a proper workaround for you.


Best regards,


Frequent Visitor

I wanted to find out which of the Users within CRM (MsDyn365CE) do have at least one Security Role assigned.


Technically spoken the relationship between a System User and a Security Role ist set up by a hidden intersect entity called "Systemuserroles":


I found out now that you are able to query it with Flow by using the EntitySetName "systemuserrolescollection".

So this is wonderful! I created a Flow now which sets a flag on the User record as soon as he has a Security Role associated. I think I even could post all of the Security Role Names into a comma separated string into a  field of the User record.

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Kudoed Authors
Users online (2,081)