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 Apps / Assign record visibili...
Power Apps
Answered

Assign record visibility by geo-area in model driven app

(0) ShareShare
ReportReport
Posted on by 8

Hi to all,

 

I need that users can see/update entities record where the area of the record is equal to user area, I'll try to explain what i test.

 

1. Add new custom entity 'areas'

2. Add 1:N relationship 'users' (1) => (N) 'areas'

3. Add lookup field to 'areas' in one ore more entities eg. 'contacts'

4. Add new entity user_to_contacts that has these relationships: (1) user => (N) user_to_contacts, (1) contacts => (N) user_to_contacts.

5. Add new grid for 'users' that filter on currentuser.id = user_to_contacts.user_id

6. When add/remove an area from a user update user_to_contacts adding/removing records

7. When add/remove/change contact's are update user_to_contacts adding/removing records

PS: i tried 1 to 5 step and it works, instead of use 'users' i think it works also with 'teams' entity.

 

My questions are:

Is this a good and practicable idea? If yes, some one can explain me ho to do 6 and 7 points?

Is there a smarter approach to do this? I try also to create a TeamArea1, TeamArea2 ..... TeamAreaN and assign the records to the team and not to the users security is not exported for solutions.

 

Thanks in advance

 

 

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @nicfil ,

    Based on the step4 that you mentioned, within your "user_to_contacts" Entity, the user and the contact would have a N:N relationship, is it right?

     

    Regarding the Step6, I suppose that you want to remove related records related to this specific user against these contacts are related to this removed area.

    Regarding the Step7, I suppose that you want to remove related users related to this specific contact against these users are related to this remove area, is it right?

     

    For Step1 through Step5, I think it is a practicable idea, which could be achieved in your Model-Driven app. But for Step6 and Step7, I afraid that there is no way to achieve your needs in Model-Driven app.

     

    If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

    https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

     

    Note: The Parental Relationship Advanced behavior could only applied to Entities related with One-to-Many or Many-to-One relationship directly rather than Entities related with indirect relationship. Please check the following article for more details:

    https://docs.microsoft.com/en-us/powerapps/maker/common-data-service/data-platform-entity-lookup#add-advanced-relationship-behavior

     

    Best regards,

  • nicfil Profile Picture
    8 on at

    Hi @v-xida-msf,

     

    Thanks for your reply,

     

    For step4: yes!

     

    For step6: when an area is added to a users then add relationships to all contact in the same area, when an area is removed from users then remove all relationships  to contacts.

     

    For step7: when an area is added to a contact then add relationships to all users in the same area, when an area is removed from contact then remove all relationships to users.

     

    For step6 and step7, can i use a js plugin?

     

    Thanks again

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @nicfil ,

    Yeah, I agree with you. For your scenario, I think custom JavaScript code may be the only available solution.

     

    More details about Client APIs supported in Model-Driven app, please check the following article:

    https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference

     

    Best regards,

  • nicfil Profile Picture
    8 on at

    hi @v-xida-msft,

     

    Thanks for your help, i have last question, is the use of custom js limited for an app that i want to publish on appsource?

     

    Best Regards.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard