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 / Acces organizationid w...
Power Apps
Answered

Acces organizationid within PCF

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi 

 

I'm building some PCF's for Dynamics 365 CE. 
One of the issues I encountered is the need to acces the organizationId from where the pcf is currently running. 

I found it to be available inside the context-input : 

Context.mode.orgSettings._customControlExposedOrgSettings.organizationId

 

Will this be supported in the future? 

  • Verified answer
    Diana Birkelbach Profile Picture
    3,072 Most Valuable Professional on at

    Hi @Anonymous ,

    I couldn't found the organizationid in the context, but you can still add the webAPI feature to your PCF and make a supported request for that:

    context.webAPI.retrieveMultipleRecords("organization", "?$select=organizationid")
    .then((resp) => resp.entities[0].organizationid)
    .catch(console.error)

    Best regards,

    Diana 

  • Danish N. Profile Picture
    186 on at

    @Anonymous 

    I was able to find the organizationId here:

    context.orgSettings._customControlExposedOrgSettings.organizationId

    But as it is not documented and also the way it is named I don't think it will be supported in future. In case it gets exposed, most probably it will get refactored under some other property.


    ----
    Danish Naglekar | Power Maverick
    If this post helps, then please consider Accept it as the solution to help the other members.

      

  • RajYRaman Profile Picture
    270 on at

    @Anonymous- This works in model driven app.

    Xrm.Utility.getGlobalContext().organizationSettings.organizationId

     

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

    Hi @Anonymous ,

    I agree with  @DianaBirkelbach 's thought almost. You could use the the context.webAPI.retrieveMultipleRecords() Client API could achieve your needs.

     
    Please check the following article for more details:
     
    In addition, I also find the orgSettings feature under the context, but the orgSettings feature is not released under PowerApps Component Framework currently.
     
    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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard