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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / Invalidating Power Pag...
Power Pages
Suggested Answer

Invalidating Power Page Cache

(1) ShareShare
ReportReport
Posted on by 81
Have you ever had issues with data visibility on Power Pages? 🧐

On my Power Page, I have a page with a view of a table T. The visibility of a user on T is governed by an Account-type Table Permission on a specific Lookup: if the logged-in user is associated with an account A0, the user will only see records of T filtered by A0.

But what happens if the user has to access to multiple accounts? 🤔

In my case, the user should be able to see more than one account [A0, A1, A2]. That is why I would like to provide him with a dropdown that updates the contact of the LoggedUser to allow them to choose whether to see the records of A0, A1, or A2.

The problem I'm facing is that after the update, Power Page takes a while to apply the new visibility rules. It seems something related to the Cache server side, is there any way to let Power Page apply the change immediately?
Categories:
I have the same question (0)
  • Suggested answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at
    Hi, how exactly are you applying those visibility rules? 
     
    also, just so I understand the data model.. you have?
     
    - User (Contact) is associated with Account X via OOB relationship
    - Table T has a lookup to Account and you have multiple T records assigned to different accounts
    - Table Permission against Table T has Account scope?
     
    if that's the setup, the user should have access to all T records associated with their account
  • ___Pool___ Profile Picture
    81 on at
     
    1. User (Contact) is associated with Account X via OOB relationship YES
    2. Table T has a lookup to Account and you have multiple T records assigned to different accounts YES
    3. Table Permission against Table T has Account scope? YES
     
    if that's the setup, the user should have access to all T records associated with their account He does access records of Account X and only those of X.
     
    The next step, what I need to achieve, is to allow the user to see and edit T records of of multiple accounts not just X but also [A0,A1,A2] , or, to let him change its own Contact.account (at point 1.) from X to A0 so he can decide to serve A0 and later on A1 or back to X and so on....
     
    I thought that letting the LoggedUser edit her referenced account at point (1.) would do the job but seems the cache prevents the changes to be applied on the fly, cause when the Contact.Account reference is changed such as from X to A0 the visibility stays on X for few minutes then it switches to A0. That is why this thread Subject: Is there a way to programmatically invalitade the cache? is it possible to configure and diminish the time for cache invalidation? Is it possible to disable the cache? Do you have any other suggestion?
     
    This requirement serves to allow a user work on different accounts cause the Business Scenario allows this situation.
  • Suggested answer
    Fubar Profile Picture
    8,363 Super User 2025 Season 2 on at
    The out of the box relationship that Account scope uses - only works for 1 Account per Contact record.
     
    You would need to establish a many-to-many (either manual where you create the intersect or using out of the box N:N) between Account and Contact. and a set of Appropriate Table permissions, that would use the Parent scope rather than Account scope.
     
    Note: depending on what you are doing in regards to the Child records of the Account, it can get very messy very quickly as the security model is by default is built around Contacts, and those Contacts only being for 1 Account.
  • ___Pool___ Profile Picture
    81 on at
    Hi @Fubar I understand this is the rule: The out of the box relationship that Account scope uses - only works for 1 Account per Contact record.
     
    My idea was easy I am the user of Power Page: a contact linked to an account A0
     
    1. When I access the Power Page I only see records of T filtered by A0, this works!
    2. If I change on my contact rhe account relation from A0 to A1, this change takes a while from Power Page to be applied in fact: I still see records of A0 for a couple of minutes refreshing the web page in the browser. Then Power Page visibility engine applies the change and I see records of T filtered by A1 as it should be.
    That's why I opened this thread to ask if is there a way to let Power Page apply this change soon as it happens
     
    Thanks for your help
  • Suggested answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at
    Apologies for the delay, I haven't had time to look at the forum lately

    I agree with Fubar here, in your scenario it looks like the Contact and Account relationship should be an N:N. There is an OOB relationship for that as well and you can use it.
     
    I personally don't like allowing users to select from any Account in my Portals, unless you have a different way of restricting which accounts they can see.
     
    So basically you need to:
    - set permissions to the Account table, specifying the Contact as scope, and set to the N:N relationship
    - set permissions to the Table T, with Parent as scope, and set the parent to the Account table permission
     
    This should allow your Contacts to view all data from the Accounts that they are connected to
     
    btw, just to answer about the cache question. it is not possible to clear the cache programmatically or disable it. There are ways to bypass if you are doing custom queries via Fetch or API, but ultimately, I don't think that's your problem here.
  • Suggested answer
    oliver.rodrigues Profile Picture
    9,368 Most Valuable Professional on at
    Also, I just tried your solution, having the user (Contact) changing the Account that they are associated with and then checked the data from my list, the filter/permission was applied correctly and I could see the new "Table T" for the new account in real-time
     
    For my test, I am using the OOB Profile page to change the account, and then refreshing a separate page with a List component
     
    As I mentioned earlier, normally I wouldn't like to expose every account for a user to pick, so not sure if this would be my preferred option unless I filter the Accounts they can select 

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 78 Super User 2025 Season 2

#2
Jerry-IN Profile Picture

Jerry-IN 75

#3
sannavajjala87 Profile Picture

sannavajjala87 31

Last 30 days Overall leaderboard