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 / Problem Accessing Powe...
Power Apps
Answered

Problem Accessing Power Fx Function

(1) ShareShare
ReportReport
Posted on by 19
I created a Power Fx Function, added it in a solution and using it in a custom page. To use the function, I connected to the Environment table. Everything works fine.
 
However, when I publish the solution to our production environment, users are not able to access the Power Fx Function. They are getting an error like below:
 
Environment.<name of my function> failed: {"error": {"code":"0x80040265","message":"Plugin failed with: Error attempting Query Microsoft.Xrm.Sdk.Query.QueryExpression returned nothing. Principal user (Id=xxxx..., type=8, roleCount=2, privilegeCount=465, accessMode='0 Read-Write', AADObjectld='xxxx...', MetadataCachePrivilegesCount=5701, businessUnitld=xxxx...), is missing prvReadCustomAPI
 
It seems that the users are missing priveleges to access the function. I have a security role created which has read/write to all the tables the function is using. I cannot add the Environment table to the security role because that table does not show up in the roles configuration.
 
So, I'm at a loss and don't know how to grant permissions to the Power Fx function for all the users. It works for me because I have elevated priveleges. I know that the Power Fx Functions are still in Preview so this could be something not thought of or implemented.
 
If any of you have any advise, I would greatly appreciate it to hear about it.
I have the same question (0)
  • Verified answer
    stampcoin Profile Picture
    5,153 Super User 2026 Season 1 on at
    The error message means you have to grant the user/role the read access to Custom API table.
    Select the correct Environment, Then Settings->Security roles, find your role.
    Then search Custom API, grant the role read access.
     
    See below pic.
     
  • Good.Panos Profile Picture
    19 on at
    Oh wow! That was it!
     
    Thank you for your guidance. I knew there was a table I needed to grant access but didn't know which one. The most obvious one was the Environment table but that's not available.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 955

#2
11manish Profile Picture

11manish 652

#3
Valantis Profile Picture

Valantis 626

Last 30 days Overall leaderboard