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 Apps / How to access the unde...
Power Apps
Answered

How to access the underlying entity in Standard control

(0) ShareShare
ReportReport
Posted on by 25

I'm building a PCF standard control and I want to access the underlying entity. I dont want to use input parameters for that in this specific case because that doesn't automatically save the entity at the time of change.

 

I could do this by calling context.webAPI.updateRecord() (I guess?) but I need entity type and ID of course. How I get this information in standard component as the .dataSet.records is not available? It would feel a bit stupid to have to give this information as input properties which the user of the component would have to set correctly in the form editor.

I have the same question (0)
  • Verified answer
    Danish N. Profile Picture
    186 on at

    If you are looking to access EntityId and EntityTypeName then this was already answered in the following post: https://powerusers.microsoft.com/t5/PowerApps-Component-Framework/Access-Page-Context-within-a-component/m-p/362492/highlight/true#M879

     

    context.mode.contextInfo.entityId
    context.mode.contextInfo.entityTypeName

    As these are currently unsupported you will need to use

    @ts-ignore
  • Mikko_K Profile Picture
    25 on at

    Thanks for the super fast response!

     

    One thing I noticed I would also need is the name of the field where the component is attached to. Meaning the name of field mapped to the main (first) input property. This is likely impossible to find out so for that one I need a manual input property. If someone has a way though, it would be nice to know.

  • Danish N. Profile Picture
    186 on at

    That is part of the context.

     

    context.parameters.YourParameterName.attribute.LogicalName

     

     

  • Verified answer
    Mikko_K Profile Picture
    25 on at

    Thanks again, perfect. So many hidden things. You have a missing "s" from "attribute". As a summary for anyone else looking for these things:

    Entity ID:

    context.mode.contextInfo.entityId (add typing to componentframework.d.ts)

    Entity logical name: 

    context.parameters.YourParameterName.attributes.EntityLogicalName

    Field logical name:

    context.parameters.YourParameterName.attributes.LogicalName

     

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 445

#2
WarrenBelz Profile Picture

WarrenBelz 386 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 321 Super User 2025 Season 2

Last 30 days Overall leaderboard