Writes records to Microsoft Dataverse tables via Python SDK, CLI, or MCP tools. Supports create, update, delete, upsert with alternate keys, bulk CreateMultiple/UpsertMultiple, CSV import, multi-table foreign-key loads, DataFrame write-back, and schema-driven sample data.
Ships in dataverse. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Create, update, delete, upsert, and bulk-import records in Microsoft Dataverse.
Python and the
dataverseCLI only. Do not script Dataverse with Node.js or JavaScript. If you are about to runnpm installfor a script or write a.jsfile, stop — see the hard rules in dataverse-overview.
| Need | Use instead |
|---|---|
| Query, filter, aggregate, export records | dataverse-query |
| Tables, columns, relationships, alternate keys, forms, views | dataverse-metadata |
| Export or deploy solutions | dataverse-solution |
| Volume / shape | Surface | Why |
|---|---|---|
| 1 record, one-liner | CLI dataverse data create/update/upsert/delete | No script, no workspace setup |
| 2–25 records, interactive | MCP create_record / update_record / delete_record | Up to 25 records per call |
| 25+ records, transformation, retries, CSV | SDK client.records.* | CreateMultiple/UpsertMultiple, paging, retry |
| Upsert by alternate key | CLI data upsert or SDK UpsertItem | MCP has no upsert tool |
| Associate / disassociate, file upload | CLI data associate / data upload | One-liner |
CLI fast path: if dataverse auth who shows an active profile, CLI writes work immediately — no .env, auth.py, or pip. SDK and bulk work still need the workspace set up by dataverse-connect.
Scripted writes use the SDK, not hand-rolled HTTP. The SDK carries auth, paging, and retry. Import get_client — not get_token plus requests. get_token() exists only for genuine gaps (global option sets, unbound actions), and even there prefer the managed dataverse api escape hatch.
| Supported | Not supported (use the alternative) |
|---|---|
| create, update, delete | Global option sets — see dataverse-metadata |
| Upsert with alternate keys | N:N association — CLI dataverse data associate or POST .../<entity>(<id>)/<nav>/$ref |
| CreateMultiple, UpdateMultiple, UpsertMultiple | $apply aggregation — use client.query.fetchxml() (dataverse-query) |
| File column uploads (chunked above 128 MB) | Unbound actions (PublishXml, InstallSampleData) — dataverse api request / invoke |
| Lookup reads inside a write workflow | DeleteMultiple, general OData $batch |
| Context manager with connection pooling |
Forms and views (systemform / savedquery) are ordinary records — write them with client.records.* (see dataverse-metadata).
PyPI package: PowerPlatform-Dataverse-Client (GA 1.0.0). It is the only official package — never install dataverse-api or other look-alikes.
# Create (--table is the EntitySet name)
dataverse data create --table accounts --data '{"name":"Contoso"}' --return --json
# Update by GUID
dataverse data update --table accounts --id <guid> --data '{"name":"Contoso (updated)"}' --json
# Upsert by alternate key (idempotent)
dataverse data upsert --table accounts --key "accountnumber='ACC-001'" --data '{"name":"Contoso Ltd"}' --json
# Delete (--no-confirm skips the prompt)
dataverse data delete --table accounts --id <guid> --no-confirm
# Associate (N:N or lookup)
dataverse data associate --table accounts --id <guid> --relationship contact_customer_accounts --related contacts --related-id <contact-guid>
# Disassociate (N:N: pass --related-id; clearing a lookup: omit it)
dataverse data disassociate --table accounts --id <guid> --relationship contact_customer_accounts --related-id <contact-guid>
# Upload to a file column (--table is the LogicalName here, not the EntitySet)
dataverse data upload --table account --id <guid> --column new_document --file report.pdf
# Describe schema (attributes, relationships, actions)
dataverse data describe --table account --include all --json
# Invoke a custom API (find names with 'dataverse api list')
dataverse api invoke <CustomApiName> --target dataverse --param Input=value
# Raw escape hatch for built-in actions (--target is required)
dataverse api request --target dataverse --path "/api/data/v9.2/WhoAmI"
import os, sys
sys.path.insert(0, os.path.join(os.getcwd(), "scripts"))
from auth import get_client
client = get_client()
get_client() loads .env, resolves the environment URL, and handles auth (see scripts/auth.py, installed by dataverse-connect). For scripts that run to completion, wrap the client in a with block for connection cleanup; in notebooks the bare client is fine.
Wrong casing is the most common cause of HTTP 400.
| Property type | Convention | Example | Used in |
|---|---|---|---|
| Structural (columns) | LogicalName, always lowercase | new_name | Payload keys |
| Navigation (lookups) | Navigation property name, case-sensitive per $metadata | new_AccountId | @odata.bind keys |
The SDK lowercases structural keys but preserves @odata.bind key casing.
# Create
guid = client.records.create("new_ticket", {
"new_name": "Ticket 001",
"new_priority": 100000002, # choice: integer value, never the label
"[email protected]": "/accounts(<account-guid>)",
})
# Update
client.records.update("new_ticket", guid, {"new_status": 100000001})
# Delete
client.records.delete("new_ticket", guid)
@odata.bind rules@odata.bind; value is "/<EntitySetName>(<guid>)".s (country → countries). Look it up in EntityDefinitions?$select=LogicalName,EntitySetName.| Lookup | Correct key | Wrong |
|---|---|---|
Custom new_AccountId | [email protected] | [email protected] |
Polymorphic customerid | [email protected] | [email protected] |
parentcustomerid | [email protected] | [email protected] |
Find the navigation property name: after creating a lookup with the SDK, read result.lookup_schema_name. For existing tables:
GET /api/data/v9.2/EntityDefinitions(LogicalName='<entity>')/ManyToOneRelationships?$select=ReferencingEntityNavigationPropertyName,ReferencedEntity
# Bulk create (CreateMultiple)
records = [{"new_name": f"Ticket {i}", "new_priority": 100000000} for i in range(500)]
guids = client.records.create("new_ticket", records)
# Broadcast one change to many records (UpdateMultiple)
client.records.update("new_ticket", [id1, id2, id3], {"new_status": 100000001})
The SDK does not chunk. It sends the whole list in one POST. There is no fixed record-count limit; the limits are payload size and the 120 s POST timeout. Chunk in your script: start at 1,000, double on success up to 4,000, halve on 413/500/timeout and cap at the last good size. Narrow tables tolerate larger chunks. The adaptive bulk_upsert / bulk_create helpers are in references/multi-table-fk-import.md.
client.dataframe.update("opportunity", df_updates, id_column="opportunityid") # df must include the PK
guids = client.dataframe.create("opportunity", df_new_records) # returns a Series of GUIDs
DataFrame write-back supports create and update only — no upsert. Reads into DataFrames are in dataverse-query.
Idempotent — re-running never creates duplicates. The alternate key must already exist on the table (dataverse-metadata).
from PowerPlatform.Dataverse.models.upsert import UpsertItem
client.records.upsert("account", [
UpsertItem(alternate_key={"accountnumber": "ACC-001"},
record={"name": "Contoso Ltd", "description": "Primary account"}),
UpsertItem(alternate_key={"accountnumber": "ACC-002"},
record={"name": "Fabrikam Inc"}),
])
Never repeat alternate key columns in record. Single upsert tolerates it; UpsertMultiple fails with "An unexpected error occurred".
Use create() only for one-shot loads. Anything that might be re-run should use UpsertItem (see above and the multi-table reference).
import csv, os, sys
sys.path.insert(0, os.path.join(os.getcwd(), "scripts"))
from auth import get_client
client = get_client()
with open("data/customers.csv", newline="", encoding="utf-8") as f:
rows = list(csv.DictReader(f))
records = [{"new_name": r["name"], "new_email": r["email"]} for r in rows]
chunk_size = 1000 # one POST per chunk; raise for narrow tables
for i in range(0, len(records), chunk_size):
guids = client.records.create("new_customer", records[i:i + chunk_size])
print(f"Imported {i + len(guids)}/{len(records)}", flush=True)
When the source has a business key (e.g. email) and Dataverse needs a GUID, build a map first:
email_to_guid = {
r["new_email"]: r["new_customerid"]
for r in client.records.list("new_customer", select=["new_customerid", "new_email"])
}
records = []
for row in rows:
customer_guid = email_to_guid.get(row["customer_email"])
if not customer_guid:
print(f"Skipping row, unknown email: {row['customer_email']}", flush=True)
continue
records.append({
"new_channel": row["channel"],
"[email protected]": f"/new_customers({customer_guid})", # verify EntitySetName
})
guids = client.records.create("new_interaction", records)
Before bulk-creating into account, contact, opportunity, etc.:
HttpError 400 the message names the missing required field. Some requirements are plugin-enforced and not visible in describe.Load in dependency order with UpsertItem and alternate keys on source IDs:
ThreadPoolExecutor, one worker per table.@odata.bind.Invariants:
chunk_size=1000 and let the helper adapt.Full helpers, composite keys, verification, and the create-only variant: references/multi-table-fk-import.md.
Generate records inline from the table schema — table-agnostic and PII-safe (@example.com emails, 555-01xx phones).
Flow: confirm environment, table, and count (default 5) → read required columns with client.tables.list_columns(TABLE, filter="AttributeOf eq null") → pick a generator per AttributeType → client.records.create() (list form for 10+ records).
DisplayName.UserLocalizedLabel can be null — dereference safely.Confirm before running, with a concrete plan instead of an open question:
contact records with CreateMultiple, @example.com emails and 555-01xx phones, against the active pac auth list environment. Confirm, or name a different environment."For a custom table with unknown schema, say you will query EntityDefinitions for required columns first, then confirm the count.
Template and safety rules: references/sample-data-generation.md.
from PowerPlatform.Dataverse.core.errors import HttpError
try:
guid = client.records.create("new_ticket", {"new_name": "Test"})
except HttpError as e:
print(f"Status {e.status_code}: {e.message}")
if e.details:
print(f"Details: {e.details}")
| Status | Likely cause |
|---|---|
| 400 | Wrong field name or casing, bad @odata.bind, missing required field, alternate key column in upsert body |
| 403 | Missing security role privileges |
| 404 | Table or record not found |
| 413 / 500 on bulk | Chunk too large — halve it |
| 429 | Throttled; the SDK retries — reduce chunk size if it persists |
.py files — curly quotes and em dashes cause SyntaxError on Windows.python -c for multi-line code; write a .py file.str(uuid.uuid4())), not via shell substitution.flush=True on progress prints.| Reference | When to load |
|---|---|
| references/multi-table-fk-import.md | Importing several related tables, adaptive chunking helpers, composite keys, post-import count verification |
| references/sample-data-generation.md | Generating sample/seed records for any table |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
/dataverse:dataverse-datafrom dataverse
npx claudepluginhub atc-net/atc-agentic-toolkit --plugin dataverse8 skills in this plugin
/dataverse-adminEnvironment-level Microsoft Dataverse administration: bulk delete, retention and archival, organization settings, OrgDB settings, recycle bin, audit, and a hard allowlist of 37 Power Platform admin center toggles. USE FOR: bulk delete records, schedule bulk delete job, cancel or pause bulk delete, data retention policy, archive old records, enable auditing, audit retention, plugin trace log, org settings, pac org update-settings, OrgDB settings, enable MCP server, Dataverse search, TDS endpoint, recycle bin on or off, recycle bin cleanup days, app-level security roles toggle, multi-environment settings rollout. DO NOT USE FOR: record CRUD or sample data (use dataverse-data), tables and columns (use dataverse-metadata), reading records (use dataverse-query), solution export or import (use dataverse-solution), security roles and self-elevate (use dataverse-security).
/dataverse-connectOne-step, idempotent setup and connection diagnostics for a Microsoft Dataverse environment: installs tools, authenticates the Dataverse CLI and PAC CLI, writes `.env`, copies the Python auth helper into the project, registers the Dataverse MCP server, and verifies the connection. USE FOR: connect to Dataverse, set up a new Dataverse project, switch environment, fix Dataverse authentication, dataverse auth create, pac auth create, register Dataverse MCP server, MCP not working, allowlist MCP client, dataverse mcp allow, scripts/auth.py --check, privilege preflight. DO NOT USE FOR: creating tables or columns (use dataverse-metadata), reading or writing records (use dataverse-data), querying data (use dataverse-query), solution export or import (use dataverse-solution), environment settings (use dataverse-admin).
Other plugins' skills for the same job