Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Suggested answer

RecordInfo - when does it work?

(0) ShareShare
ReportReport
Posted on by 375

I am trying to use RecordInfo on a Dataverse table to determine if the user has Delete permissions on a record.  It does not seem to return the correct answer when the record ownership has been changed in one application session.

 

The current record is in a variable called 'currentRecord'. PowerApps correctly evaluates this when the user comes into the app fresh.

 

The app lets the user submit the record to an approver - upon which the Owner is changed, and the user loses Update/Delete access, as I can confirm using 'Check Access' in a model-driven view of the table (in another app). But RecordInfo keeps saying the user has Delete access.

 

I've tried refreshing the dataset, and using LookUp to pull in a 'fresh' copy of 'currentRecord' before doing the RecordInfo check - even calling RecordInfo with a LookUp as the first argument. Nothing changes. The user has to exit the app, and re-enter, before the answer is correct.

 

The inverse also happens: The user can 'Recall' the record, in which case Ownership is transferred back to the user (I use Flows and Process Actions to change the owner on 'Recall'). But RecordInfo will never return 'true' for the 'Delete' permission, unless the user exits and re-enters the app.

 

Any insight on what PowerApps is actually doing under the covers here?

 

Categories:
  • Suggested answer
    powerJu Profile Picture
    34 on at
    RecordInfo - when does it work?
    I was having the same issue, but it seems take just few minutes to refresh it. 
    In my case I was using it to make a button visible so if the user make a change in the record that sends the ownership to other use and give him read access only (using Power Automate) - User should not see some buttons. But if user goes quickly to the record they will see it.
    It takes 2 minutes to them to disappears.
    So I used the 
    If(IsError(Actions that you want button to perform), 
    Notify(
            "You don't have privileges to perform this action. ",
            NotificationType.Error
        ));

    It prevents user to click and make it work.
  • mitchbaker Profile Picture
    2 on at
    RecordInfo - when does it work?
    I have this same problem... I change the owner and the permissions do change but RecordInfo seems to cache the old permissions which gives the user running the app an incorrect view, albeit unable to actually use those permissions.
     
    Tried a Refresh() etc and a lookup on the record.
  • Len C Profile Picture
    375 on at
    Re: RecordInfo - when does it work?

    I've tried Refresh()ing the dataset, ad nauseum. I also tried firing RecordInfo(LookUp('table', id=Gallery1.Selected.id)) so that the first argument to RecordInfo is called with a 'fresh record' straight from the data source.

     

    Based on further testing, it looks like RecordInfo caches results, AND DOES NOT EVER REFRESH THOSE RESULTS, EVEN WHEN THE DATASET IS REFRESHED. It only refreshes with a browser Refresh - i.e., leave the app and come back in.

     

    This makes RecordInfo pretty useless. If someone has an app open all day, and record permissions are changing due to data being updated, they will only see the 'correct' answer for permissions for a given record ONCE - the first time the app calls RecordInfo for that record. After that, the first answer will always be returned.

     

    I can see how Microsoft would have wanted to aggressively cache RecordInfo() results, as many devs will probably tie control Visibility and DisplayMode to RecordInfo permission checks. Resulting in many, many calls to the datasource without caching. But they purposefully left this issue in? 

  • Michael E. Gernaey Profile Picture
    40,666 Super User 2025 Season 1 on at
    Re: RecordInfo - when does it work?

    Hi,

     

    My guess is that you haven't done a Refresh(DataSource), so it has the old stuff cached.


    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,601 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,942 Most Valuable Professional

Leaderboard