web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Query Dynamics 365 CE ...
Power Automate
Unanswered

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

(0) ShareShare
ReportReport
Posted on by 35

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?

Categories:
  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    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,

    Alice

  • moko33 Profile Picture
    35 on at

    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": 

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/entities/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.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 263

#3
Henil Profile Picture

Henil 115

Last 30 days Overall leaderboard