I am working on a custom PCF, that uses the WEBAPI to fetch other records.
It seems that the api returns different types depending whether it is run in a Model Driven app or on a Power Page, therefore I need to use Nullish coalescing to get the entity properties:
this
._context
.webAPI
.retrieveRecord("account", "a78cdf88-7e04-ee11-8f6e-000d3aacaa23", "")
.then((response) => {
console.log("get account ok: " + (response.name ?? response.data?.name));
}, (errorResponse) => {
console.log("error :" + errorResponse);
});
In Model Driven app it is just an entity object, but in Power Pages it is an object with a "Data" property in which the entity object lives:
Model driven:

Power Pages:

Is this the expected behaviour or am I missing something?
A side question, is there any way to use early binding? I have tried using dataverse-ify, but Xrm is apparently not available in Power Pages...