BatchResult Class

Result of executing a batch request.

Contains one BatchItemResponse per HTTP operation submitted. Operations that expand to multiple HTTP requests (e.g. add_columns with three columns) contribute three entries.

Example:


   result = client.batch.new().execute()
   print(f"Succeeded: {len(result.succeeded)}, Failed: {len(result.failed)}")
   for guid in result.entity_ids:
       print(f"[OK] entity_id: {guid}")

Constructor

BatchResult(responses: ~typing.List[~PowerPlatform.Dataverse.models.batch.BatchItemResponse] = <factory>)

Parameters

Name Description
responses

All responses in submission order.

Default value: <factory>

Attributes

entity_ids

GUIDs extracted from OData-EntityId headers of successful responses.

Returns entity IDs from any successful (2xx) response that includes an OData-EntityId header. Both individual POST (create) and PATCH (update) operations return this header with the record's GUID. GET and DELETE operations do not.

Note

CreateMultiple and UpsertMultiple action responses do not

return per-record OData-EntityId headers. Their IDs are in the

JSON response body (data["Ids"]). Access them via:

for resp in result.succeeded:

if resp.data and "Ids" in resp.data:

    bulk_ids = resp.data["Ids"]

failed

Responses with non-2xx status codes.

has_errors

True when any response has a non-2xx status code.

succeeded

Responses with 2xx status codes.

responses

responses: List[BatchItemResponse]