UpsertMultiple Action
Upsert (Create or Update) multiple records of same type in a single request.
Example
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.typeannotation with every item in theTargetsparameter. - The
UpsertMultipleaction returns204 NoContent. TheUpsertMultipleResponsecomplex 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.
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. |
| flowaggregation | Flow Aggregation | |
| flowlog | Flow Log | |
| flowrun | Flow Run | |
| indexedtrait | indexedtrait | |
| msdyn_timelinepin | Timeline Pin | Timeline Pin Record |
| nlsqregistration | NL2SQ Registration Information | Org registration status, AllowedEntity list, and registration error message. |
| powerpageslog | Power Pages Log | |
| powerpagessiteaifeedback | Power Pages Site AI Feedback | |
| 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 |
| sharedworkspaceaccesstoken2 | Shared Workspace Access Token | Contains information about the shared workspace access tokens. |
| signal | signal | |
| sourcecontrolbranchconfiguration | Source Control Branch Configuration | Stores the source control branch configuration associated with the organization or solution |
| sourcecontrolcomponent | Source Control Component | Stores the Source Control Components associated with the organization or solution |
| sourcecontrolcomponentpayload | Source Control Component Payload | Stores the Source Control Component Payloads associated with components. |
| sourcecontrolconfiguration | Source Control Configuration | Stores the git configuration associated with the environment |
| stagedsourcecontrolcomponent | Staged Source Control Component | Stores the source control components that needs to be processed |
| textdatarecordsindexingstatus | TextDataRecordsIndexingStatus | Stores information about unstructured / text data records indexing status |
| trait | trait |