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 / Retrieving the ID prop...
Power Apps
Answered

Retrieving the ID property of an EntityReference

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I've have just started my adventures in PCF and I have come across a problem I hope someone can help with.

I have created a custom control passing in a dataset which contains an owner column. I am trying to retrieve the id of this owner, by doing the following:

let owner = this._dataset.records[recordId].getValue("ownerid") as ComponentFramework.EntityReference;

TypeScript then offers me the following options in intellisense:

Code_2019-08-01_09-35-01.png

So I choose "owner.id" to get the id.

However, when this code runs this "id" is not the id, but an object containing a property called "guid":

msedge_2019-08-01_09-38-54.png

If I try to use owner.id.guid in my TypeScript file I get an error and it fails to build.

Am I doing something wrong here? I am pretty new to TypeScript so probability is high.

Thanks

Jason

I have the same question (0)
  • Verified answer
    Greg Hurlman (MSFT) Profile Picture
    Microsoft Employee on at

    @Anonymous - It's not you, it looks like you've found a bug in our TypeScript type definition file. To work around it, you can modify the file in your project:

    Open <project directory>\node_modules\@types\powerapps-component-framework\componentframework.d.ts.

    Modify line 1257 from

    id: string;

    to

    id: { guid: string };

    This will allow the TypeScript compiler's typechecking to pass.

     

    I am in the process of getting our type files and documentation updated to reflect runtime reality; will update the thread once those changes have gone through.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @GregHurlmanMSFT - Looks like there is a similar issue with the entityType property, the actual property name is etn.

     

    I updated line 1262 of the type definition from

    entityType?: string;

    to

    etn?: string;

    and it works as expected.

  • Greg Hurlman (MSFT) Profile Picture
    Microsoft Employee on at

    @Anonymous Yep, saw that yesterday as well, thanks! I've got a PR open to update our types; as soon as it goes in, if you update the version number of the powerapps-component-framework package to "^1.2.0" and run npm install again, you'll get the changes.

  • Bhuvita Sisodiya07 Profile Picture
    78 on at

    @Greg 

    Is this issue still open because i am still facing the issue.

    EntityReference.PNG
  • TekTadhg Profile Picture
    4 on at

    I'm still facing this issue when using version "^1.2.0". Has this fix gone in?

  • TekTadhg Profile Picture
    4 on at

    I was able to get around this by updating the version of "@types/powerapps-component-framework" in my package.json to "^1.3.4"

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 70

#2
WarrenBelz Profile Picture

WarrenBelz 64 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 36 Super User 2026 Season 1

Last 30 days Overall leaderboard