Skip to content

pacx data update

github-actions[bot] edited this page Jul 19, 2026 · 1 revision

Updates an existing record in a Dataverse table.

Usage

Overview

This command updates an existing record in the specified Dataverse table. The --id option is required and identifies the record to update. Field values can be provided using a plain key=value syntax, a JSON string, or a JSON file.

Input modes

Exactly one of the following input modes must be used (they are mutually exclusive):

  • --plain (-p): semicolon-separated list of field=value pairs, e.g. firstname=Mario;lastname=Rossi
  • --json (-j): a JSON object string representing the record payload
  • --file (-f): path to a JSON file containing the record payload

Supported field types

Type Format Example
String / Memo Any text value firstname=Mario
Integer Whole number numberofemployees=100
Decimal / Double Decimal number revenue=1234.56
Money Monetary value estimatedvalue=50000
Boolean true/false, 1/0 donotbulkemail=true
Date Only yyyy-MM-dd birthdate=1990-05-20
Date & Time ISO 8601 overriddencreatedon=2024-01-15T08:30:00Z
Choice (OptionSet) Integer code or label text statecode=0 or statecode=Active
Multi-Select Choice Comma-separated codes or labels new_tags=Red,Blue,Green
Lookup entity(GUID) or entity(field='value') ownerid=systemuser(domainname='user@org.com')

Lookup references

Lookup fields accept two formats:

  • entity(GUID): directly references a record by its GUID, e.g. ownerid=systemuser(3fa85f64-5717-4562-b3fc-2c963f66afa6)
  • entity(field='value'): resolves a record by a field value, e.g. ownerid=systemuser(domainname='mario.rossi@contoso.com')

If the field value itself contains a single quote, escape it by doubling it: entity(name='Riccardo''s Corp').

--plain escaping rules

The --plain tokenizer uses the following rules:

  • Fields are separated by semicolons (;)
  • The first = in each token separates the field name from the value; subsequent = characters are part of the value
  • Single quotes (') delimit sections where semicolons are treated as literal characters
  • To include a literal single quote in a value, write two consecutive single quotes ('')
  • An empty value (field=) is valid and sets the field to null

Options

  • --id (required): GUID of the record to update
  • --return (-r): comma-separated list of columns to retrieve after update and display; if omitted only a success message is shown
  • --dry-run (-dr): validates and displays the resolved payload without actually updating the record

Examples

# Update a contact's first name
pacx data update -t contact --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "firstname=Mario"

# Update multiple fields at once
pacx data update -t account --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "name=Acme Corp;revenue=5000000"

# Update owner using a field-based lookup
pacx data update -t account --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "ownerid=systemuser(domainname='mario.rossi@contoso.com')"

# Update and return specific fields
pacx data update -t contact --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "firstname=Mario" --return "firstname,lastname,fullname"

# Update using JSON
pacx data update -t opportunity --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --json '{"estimatedvalue":75000,"closeprobability":80}'

# Update from a JSON file
pacx data update -t contact --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --file ./update-contact.json

# Dry-run: validate the payload without updating
pacx data update -t contact --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "firstname=Mario" --dry-run

# Clear a field by setting it to empty
pacx data update -t contact --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "description="

# Update a boolean field
pacx data update -t contact --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "donotbulkemail=true"

# Update a choice field by label
pacx data update -t lead --id 3fa85f64-5717-4562-b3fc-2c963f66afa6 --plain "statuscode=New"

Arguments

Long Name Short Name Required? Description Default value Valid values
id id Y The GUID of the record to update. - Guid
table t Y Logical name of the target table. - String
dry-run dr N Validates the payload without updating the record. False true, false
file f N Path to a JSON file containing the record payload. Mutually exclusive with --plain and --json. - String
json j N JSON string representing the record payload. Mutually exclusive with --plain and --file. - String
plain p N Semicolon-separated list of field=value pairs. Mutually exclusive with --json and --file. - String
return r N Comma-separated list of columns to return after update. If omitted, only a success message is shown. - String

Command list

Clone this wiki locally