UpsertMultiple Action

Upsert (Create or Update) multiple records of same type in a single request.

Bound entities

Bound actions are invoked by appending the fully qualified action name to the URI representing an entity or collection.

Entity Type Binding Type
crmbaseentity collection

Parameters

Parameters allow for data to be passed to the action.

Name Type Nullable Unicode Description
Targets
Collection(crmbaseentity) False True

The records to create or update.

Entities

Use the UpsertMultiple action with these entity types:

Name Display name Description
appnotification Notification Notification to be provided to a user.
backgroundoperation Background Operation
cardstateitem Card State Item
componentversionnrddatasource Component Version (Internal)
elasticfileattachment ElasticFileAttachment Elastic File Attachment
eventexpanderbreadcrumb Event Expander Breadcrumb Table to store breadcrumb records of Event Expander pipeline.
flowlog Flow Log
flowrun Flow Run
msdyn_timelinepin Timeline Pin Timeline Pin Record
nlsqregistration NL2SQ Registration Information Org registration status, AllowedEntity list, and registration error message.
powerpageslog Power Pages Log
recentlyused Recently Used Most recently used data table.
searchresultscache SearchResultsCache Cache search results internally
searchtelemetry Search Telemetry Entity to log telemetry that used to improve search quality

Remarks

The list of Entities doesn't represent all the tables that support the UpsertMultiple action. Learn how to find which tables support UpsertMultiple

Important

  • You must specify the @odata.type annotation with every item in the Targets parameter.
  • The UpsertMultiple action returns 204 NoContent. The UpsertMultipleResponse complex type is not returned.

The following example shows using the UpsertMultiple action with a standard table named sample_example. These requests identify the records using an alternate key defined using a column named sample_keyattribute. The @odata.id annotation identifies the record with a relative URL as described in Use an alternate key to reference a record

Request

POST [Organization Uri]/api/data/v9.2/sample_examples/Microsoft.Dynamics.CRM.UpsertMultiple
OData-MaxVersion: 4.0
OData-Version: 4.0
If-None-Match: null
Accept: application/json
Authorization: Bearer <access token>
Content-Type: application/json; charset=utf-8
Content-Length: 850

{
  "Targets": [
    {
      "@odata.type": "Microsoft.Dynamics.CRM.sample_example",
      "sample_name": "sample record 0000001",
      "@odata.id": "sample_examples(sample_keyattribute='0000001')"
    },
    {
      "@odata.type": "Microsoft.Dynamics.CRM.sample_example",
      "sample_name": "sample record 0000002",
      "@odata.id": "sample_examples(sample_keyattribute='0000002')"
    },
    {
      "@odata.type": "Microsoft.Dynamics.CRM.sample_example",
      "sample_name": "sample record 0000003",
      "@odata.id": "sample_examples(sample_keyattribute='0000003')"
    },
    {
      "@odata.type": "Microsoft.Dynamics.CRM.sample_example",
      "sample_name": "sample record 0000004",
      "@odata.id": "sample_examples(sample_keyattribute='0000004')"
      
    }
  ]
}

Response

HTTP/1.1 204 NoContent
OData-Version: 4.0

For more information see Bulk Operation messages.

See also