Editar

Partilhar via


retrieveRecord

Retrieves a table record.

Available for

Model-driven apps & portals.

Syntax

context.webAPI.retrieveRecord(entityLogicalName, id, options).then(successCallback, errorCallback);

Parameters

Name Type Required Description
entityLogicalName String Yes The table logical name of the record you want to retrieve. For example: "account".
id String Yes GUID of the table record you want to retrieve.
options String No

OData system query options, $select and $expand, to retrieve your data.

  • Use the $select system query option to limit the properties returned by including a comma-separated list of property names. Limiting the columns you retrieve is an important performance best practice. If properties aren't specified using $select, all properties will be returned.
  • Use the $expand system query option to control what data from related tables is returned. If you just include the name of the navigation property, you'll receive all the properties for related records. You can limit the properties returned for related records using the $select system query option in parentheses after the navigation property name. Use this for both single-valued and collection-valued navigation properties.

You specify the query options starting with ?. You can also specify multiple query options by using & to separate the query options. For example:

?$select=name&$expand=primarycontactid($select=contactid,fullname)
successCallback Function No

A function to call when a record is retrieved. A JSON object with the retrieved properties and values will be passed to the function.

errorCallback Function No A function to call when the operation fails.

Return Value

Type: Promise<Entity>

Web API
Power Apps component framework API reference
Power Apps component framework overview