createRecord

Creates a table record.

Available for

Model-driven apps

Syntax

context.webAPI.createRecord(entityLogicalName, data).then(successCallback, errorCallback);

Parameters

Name Type Required Description
entityLogicalName String Yes Logical name of the table you want to create. For example: "account".
data Object Yes

A JSON object defining the columns and values for the new table record.

See examples later in this topic to see how you can define the data object for various create scenarios.

successCallback Function No

A function to call when a record is created. An object with the following properties will be passed to identify the new record:

  • entityType: String. The table logical name of the new record.
  • id: String. GUID of the new record.
errorCallback Function No A function to call when the operation fails. An object with the following properties will be passed:
  • errorCode: Number. The error code.
  • message: String. An error message describing the issue.

Return Value

Type: Promise<Entityreference>

Description: On success, returns a promise object containing the columns specified earlier in the description of the successCallback parameter.

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

Note

Can you tell us about your documentation language preferences? Take a short survey.

The survey will take about seven minutes. No personal data is collected (privacy statement).